diff --git a/fsub b/fsub index 4a56445..887de3a 100755 --- a/fsub +++ b/fsub @@ -9,12 +9,11 @@ usage() { exit 1 } -[ -z $1 ] && usage -[ -f $1 ] || usage -[ -z $2 ] || usage -[ -f $FSUBRC ] || touch $FSUBRC +[ -z "$1" ] && usage +[ -f "$1" ] || usage +[ -z "$2" ] || usage +[ -f "$FSUBRC" ] || touch $FSUBRC -cp $1 $1.bak awk ' BEGIN { n = 1 @@ -44,6 +43,5 @@ BEGIN { print time for(j = 0; j < linen; j++) print lines[j] -}' $1 | sed 's/\r//' > /tmp/fsub -mv /tmp/fsub $1 -rm $1.bak +}' "$1" | sed 's/\r//' > /tmp/fsub +mv /tmp/fsub "$1"