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
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -z $1 ] && usage
|
[ -z "$1" ] && usage
|
||||||
[ -f $1 ] || usage
|
[ -f "$1" ] || usage
|
||||||
[ -z $2 ] || usage
|
[ -z "$2" ] || usage
|
||||||
[ -f $FSUBRC ] || touch $FSUBRC
|
[ -f "$FSUBRC" ] || touch $FSUBRC
|
||||||
|
|
||||||
cp $1 $1.bak
|
|
||||||
awk '
|
awk '
|
||||||
BEGIN {
|
BEGIN {
|
||||||
n = 1
|
n = 1
|
||||||
|
@ -44,6 +43,5 @@ BEGIN {
|
||||||
print time
|
print time
|
||||||
for(j = 0; j < linen; j++)
|
for(j = 0; j < linen; j++)
|
||||||
print lines[j]
|
print lines[j]
|
||||||
}' $1 | sed 's/\r//' > /tmp/fsub
|
}' "$1" | sed 's/\r//' > /tmp/fsub
|
||||||
mv /tmp/fsub $1
|
mv /tmp/fsub "$1"
|
||||||
rm $1.bak
|
|
||||||
|
|
Loading…
Reference in New Issue