[geeks] Awk-related question

der Mouse mouse at Rodents.Montreal.QC.CA
Wed Jul 26 11:30:35 CDT 2006


> Can anyone tell me why this awk snippet does not work?  $4 is the
> field I am checking to see if it is blank or not.  The " \@LP " stuff
> is part of the formatting.

> if (length( $4 ) > 0) {
>  print " \@LP " $4
> }

Not offhand.  What is it doing that's different from what you expect?
Is the whole program something you can show?  It'd be a lot easier if I
could see more of the context.

Offlist if you like; I don't see anything in the headers to make me
think you'll have any trouble reaching me, but you never know....

> I also tried if ($4) since the empty string evals to false, but got
> nowhere with that.

Did you try if ($4 == "") { ... }?  I don't expect that to help,
though; I suspect the actual problem is elsewhere (which is why I want
to see more context).

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse at rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B



More information about the geeks mailing list