nsbin/remove_first_lines
Nico Schottelius d3c6e29902 Initial commit
2006-07-20 09:54:37 +02:00

22 lines
350 B
Bash
Executable file

#!/bin/sh
#
# Nico Schottelius <nico-linux@schottelius.org>
# Date: 15-Sep-2004
# Last Modified: -
#
# Removes the first n lines
if [ $# -ne 2 ]; then
echo "$0: "'<lines_to_cut> <file>'
exit 1
fi
CUT_LINES=$1
FILE=$2
LINES=`cat "$FILE" | wc -l`
TAIL_LINES=`echo "${LINES}-${CUT_LINES}" | bc`
echo $TAIL_LINES
tail -n "$TAIL_LINES" "$FILE"