Which option is used for reading an awk program from a file?

Answer: b
Explanation: We can store large awk programs in a separate file and provide them with a .awk extension. For example,
Code:
$ cat emp1.awk
$3== “director” || $6 > 6000 { 
count=count+1
printf “%-20s  %d\n”, $2, $6}
// commands written in emp1.awk are executed on emp.lst
$ awk  -F “|” -f emp1.awk  emp.lst
 

Tìm kiếm

Back
Top