Mostly Linux & Python syntax notes and hyperlinks.

Thursday, June 24, 2010

Linux: One minus the Line Count

To count the number of output records minus the header in one line of script:
CNT=$(($(wc -l file_with_header | awk '{print $1}')-1))

No comments:

Post a Comment