Embed Notice
HTML Code
Corresponding Notice
- Embed this notice@Zergling_man @Humpleupagus @coolboymew @moth_ball
yes
func(arg, arh); parenthesis optional
fields are $1 $2 etc. the $ are NOT accessing vars. you have built in vars like NF (number of fields) and can access them without the $. $NF actually reads $3 for NF=3
it shouldn't respect IFS iirc. it has internal IFS. pass -F 'sep pattern' or assign it in BEGIN{} block.
also it's not really pattern {action} but majority of time it will be /pattern/ {action}. the first statement can be whatever and if it evals truthy {actions} happen. clever example is you can do $0=$3 and it actually evals to $0. if $3 is empty {actions} won't run for that record.
admittedly I've written a longer awk program than 99% of awk aware population but I think it's pretty straightforward