diff --git a/README.md b/README.md index d5f5dc9..844a149 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,4 @@ # Features - Fixes subtitle numbering - Removes lines which have words listed in `~/.config/fsubrc` +- Backs up the file to a .bak (removed when no error happens) diff --git a/fsub b/fsub index 6cc963d..4a56445 100755 --- a/fsub +++ b/fsub @@ -14,6 +14,7 @@ usage() { [ -z $2 ] || usage [ -f $FSUBRC ] || touch $FSUBRC +cp $1 $1.bak awk ' BEGIN { n = 1 @@ -45,3 +46,4 @@ BEGIN { print lines[j] }' $1 | sed 's/\r//' > /tmp/fsub mv /tmp/fsub $1 +rm $1.bak