1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-24 09:35:25 +02:00

awk: add print every nth line example (#2008)

This commit is contained in:
Sinan 2018-02-22 22:05:11 -08:00 committed by Agniva De Sarker
parent d7cf40e99c
commit 2926835dd6

View file

@ -21,3 +21,7 @@
- Sum the values in the first column and pretty-print the values and then the total:
`awk '{s+=$1; print $1} END {print "--------"; print s}' {{filename}}`
- Print every third line starting from the first line:
`awk 'NR%3==1' {{filename}}`