switch in gawk

switch in gawk

Dotan Cohen dotancohen at gmail.com
Tue May 12 11:01:01 IDT 2009


> So, if you have access to the latest RHEL/SLES, or Debian / Ubuntu /
> Gentoo / whatever, would you mind running
>
> $ gawk 'END {switch(NR) {default: print NR}}' /dev/null
>

Ubuntu (Kubuntu 9.04) has it the worst!

$ gawk 'END {switch(NR) {default: print NR}}' /dev/null
The program 'gawk' is currently not installed.  You can install it by typing:
sudo apt-get install gawk
bash: gawk: command not found



But even if you get your users to install gawk, it does not support switch:

$ gawk 'END {switch(NR) {default: print NR}}' /dev/null
gawk: END {switch(NR) {default: print NR}}
gawk:                 ^ syntax error



-- 
Dotan Cohen

http://what-is-what.com
http://gibberish.co.il



More information about the Linux-il mailing list