awk files
What are the differences between the 2 awk files . ¶I can not find them
|
HUH?
Which files, what are you talking about? Cheers, Tink |
oups
oups i dit it again
:o :D A) /^$/ { print x += 1 } Â) /^$/ { print x++ } |
Kalimera! :)
I'm not an expert in awk <grin> but in C/C++ "x += 1" and "x++" can be used synonymously... Cheers, Tink |
ouaou
where are u from tinkster?
Geia sou ellada!! |
It looks like they're both the same. In C/C++, at least, I think they'd do the same thing.
print x++ prints x, then increments (post-increment, they call it) print ++x increments x, then prints (pre-increment I guess) Don't know if the same applies in awk though. |
Re: ouaou
Quote:
But I used to do classical greek at Uni, and spent a beautiful holiday in the greek part of Cyprus once :} Yassou, Tink |
hi alaios,
"print x +=1;" is same as "print ++x;" or "print x =x+1;" whereas "print x++" could be substituted by "print x +=0;" or "print x =x+0;" Hope you get the idea. A) /^$/ { print x += 1 } B) /^$/ { print x++ } Thus A would print the number of empty lines beginning with 1 whereas B would begin with 0. |
All times are GMT -5. The time now is 05:09 AM. |