Remove backup and fix files with spaces
This commit is contained in:
parent
5f51720bec
commit
1066da20f9
14
fsub
14
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"
|
||||
|
|
Loading…
Reference in New Issue