1) Format: awk 'pattern' filename awk '{action}' filename awk 'pattern {action}' filename (a) awk '/ salby / {print $ 1} filename (b) ls -l | awk' $ 1 ~ / ^ D / {Print $ 0} '(c) ls -l | awk' $ 1! ~ / ^ D / {Print $ 0} '(D) awk' / ^ (no | so) / 'datafile (e) awk -f: '$ 3 == 100 || $ 4> = 150' FileName
2) Send the shell's variable to nawk
For example:
Origin = ls -l
Originb = `ls / | nawk -v swap =" $ Origin "'{Print Swap}'
3) NAWK '$ 2> 5 && $ 2 <= 15' FileName