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:
Mark Johnston 2013-05-12 16:29:09 +00:00
parent 09e6105ff4
commit d02e5a206d
2 changed files with 4 additions and 4 deletions

View File

@ -73,8 +73,8 @@ if [ "$status" -ne 0 ]; then
fi
# dtrace outputs a blank line at the end, which will sort to the beginning,
# so use head to remove the blank line.
head -n -1 $file > $file.2
# so use sed to remove the blank line.
sed '$d' $file > $file.2
sort -n $file.2 | diff $file.2 -
status=$?

View File

@ -89,8 +89,8 @@ if [ "$status" -ne 0 ]; then
fi
# dtrace outputs a blank line at the end, which will sort to the beginning,
# so use grep to remove the blank line.
head -n -1 $file > $file.2
# so use sed to remove the blank line.
sed '$d' $file > $file.2
sort -n $file.2 | diff $file.2 -
status=$?