
01-02-2009
|
|
Shell programmer, author
|
|
|
Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,361
|
|
Quote:
Originally Posted by nj78
If you are familiar with egrep and regular expressions, then just cat the file and pipe to egrep -v to remove what you don't need. Good exercise to learn this, plenty of material to find using google.
|
Don't cat the file. Use the filename as the final argument to grep.
However, for this exercise, awk is better:
Code:
awk -F '_list' '
{ num = $2; sub( /.prn/, "", num ); num = num + 0 }
num < 21 || num > 37
' "$FILE"
|