Cover V02, I02
Article
Listing 1
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7

mar93.tar


Listing 3: flimit -- Standalone program to prune files

:
######################################################
# flimit
######################################################
# prune file to specified limit.  this one does
# not handle permissions adequately.  use mxfl

tmpfile=/tmp/sl.$$

test $# = 2 || {
echo "usage: $0 [filename] [maxlines]"
exit 1
}
tail -${2} $1 > $tmpfile
mv $tmpfile $1
exit 0