AWK:String <--> Integer ??

Tony Booker tb at sequent.sequent.com
Tue Mar 26 19:46:34 AEST 1991


In article <3135 at inews.intel.com> mbodas at natukawa.intel.com (Milind Bodas) writes:

	  When a variable is assigned using substr() function in an awk script,
   it seems that it cann't be used in certain numerical/logical operations. For
   example in following piece of code, the for loop is executed only 4 times
   instead of 38 times -



My man page for awk does say:

BUGS
     There are no explicit conversions between numbers and
     strings.  To force an expression to be treated as a number
     add 0 to it; to force it to be treated as a string concaten-
     ate "" to it.


--

The above drivel is mine.  Company drivel sounds _MUCH_ more plausible ;^)



More information about the Comp.unix.shell mailing list