Linux awk uses

  

awk '{$2=$5=""}1' meaning of file 1


awk 'pattern{action}' file

The general awk format is like this.


If written as awk 'pattern' file, the action defaults to {print $0};

pattern is a fixed value, then determine whether the value is 0 (0 Is false, non-zero is true);

pattern is a calculation expression, it is judged whether the calculation result is 0;

pattern If it is an awk command, it is judged whether its return value is 0 .


This way you can understand the meaning of awk '1' file:

The action is empty here, so the default is {print $0}; 1 is a fixed value. Non-zero, so execute the action, ie print $0

Copyright © Windows knowledge All Rights Reserved