switch in gawk

switch in gawk

guy keren choo at actcom.co.il
Mon May 11 01:54:26 IDT 2009


i fails also on ubuntu 8.04 (certainly not the latest ubuntu since 9.04 
came out, though).

--guy

Oleg Goldshmidt wrote:
> Hi,
> 
> I would like to run a tiny and trivial gawk configuration survey. 
> 
> Background: I wrote a bunch of gawk scripts lately, and without giving
> it much thought I used the switch statement quite liberally. To my
> surprise, I found out that
> 
> * switch is considered experimental in gawk
> * support for switch is not compiled in by default and must be enabled
>   at the configure stage with "configure --enable-switch"
> * neither CentOS 5.2 nor Fedora 10 have switch support enabled in gawk
> * Cygwin's gawk (coming from RedHat as well) has switch enabled
> 
> For my purposes I just pulled the gawk sources and compiled it with
> --enable-switch. My target platform is mostly Cygwin. However, I
> obviously would like to know how (non-)portable an awk script with
> switch is.
> 
> 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
> 
> (or anything with switch that you fancy) and see if it barfs with a
> syntax error message or dutifully does what it is supposed to do?
> 
> Thanks,
> 




More information about the Linux-il mailing list