From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad19,1a7ef15e5c7743b8,start X-Google-Attributes: gid10ad19,public X-Google-Thread: f678f,1a7ef15e5c7743b8,start X-Google-Attributes: gidf678f,public From: rchannav@rpspo2.atlantaga.ncr.com Subject: AWK on digital UNIX. Date: 1997/03/05 Message-ID: <331DC423.38DB@rpspo2.atlantaga.ncr.com>#1/1 X-Deja-AN: 223353242 Sender: news@avenger.daytonoh.ncr.com (News administrative Login) X-Nntp-Posting-Host: 153.76.39.81 Organization: NCR - Retail Product Systems Newsgroups: comp.unix.osf.misc,comp.lang.awk Hi All, Recently I had to write a script in awk on DIGITAL - UNIX 4.0. I was surprised by this ambiguous output and see if it is the way in DIGITAL UNIX. The code segment is as follows awk -F\, '{ ....... gsub(/ /,//,$2) print $0 ....... }' < /tmp/tmp.txt the tmp.txt is like this hello,fo o,123 foo,bar,123 bar,ba r,123 etc., Basically I am stripping the blanks from second field. The output it produces is in the following format hello,fo10,123 foo,bar,123 bar,ba1r,123 I know that gsub returns the no.of occurences, but why in $2?? Thanks -- -------------------------------------------------------- You might be a redneck if you think I speak for NCR --------------------------------------------------------