Hi what is the purpose of using underscore in awk. I suppose it is for defining macro's and reducing repeatation but can some one show me an example?
Could you give an example? I suppose it's a simple variable name without any special meaning (not like in Perl, for example).
here is the example i found in one of the posts and there are many more similar posts.
awk -v ID=$ID '$NF==ID{_=1} !NF && _{exit}_' file > request_id_data.txt
It's an ordinary AWK variable, it's the same as:
awk -v ID=$ID '$NF==ID{myvar=1} !NF && myvar{exit}myvar'
As far as my posts are concerned (the above is not mine, it's from danmero's post I think), it's just an attempt to make a boring code look nicer (like Apollinaire's poetry:)).
Sorry Its not a relevant question. I have gone a bit lousy to read the posts properly.
1 or 0 (true or false in boolean context) as far as the above example is concerned.
radoulov -Thanks for your replies