head -n doesn't take negative arguments on FreeBSD, so instead use sed '$d'
to remove the last line of a file.
This commit is contained in:
parent
8f40d761c1
commit
08da0b8fad
@ -73,8 +73,8 @@ if [ "$status" -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# dtrace outputs a blank line at the end, which will sort to the beginning,
|
# dtrace outputs a blank line at the end, which will sort to the beginning,
|
||||||
# so use head to remove the blank line.
|
# so use sed to remove the blank line.
|
||||||
head -n -1 $file > $file.2
|
sed '$d' $file > $file.2
|
||||||
|
|
||||||
sort -n $file.2 | diff $file.2 -
|
sort -n $file.2 | diff $file.2 -
|
||||||
status=$?
|
status=$?
|
||||||
|
@ -89,8 +89,8 @@ if [ "$status" -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# dtrace outputs a blank line at the end, which will sort to the beginning,
|
# dtrace outputs a blank line at the end, which will sort to the beginning,
|
||||||
# so use grep to remove the blank line.
|
# so use sed to remove the blank line.
|
||||||
head -n -1 $file > $file.2
|
sed '$d' $file > $file.2
|
||||||
|
|
||||||
sort -n $file.2 | diff $file.2 -
|
sort -n $file.2 | diff $file.2 -
|
||||||
status=$?
|
status=$?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user