The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 04-22-2009
lavascript lavascript is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 47
Red face

Oddly enough just setting IFS to nothing seems to have fixed it.

I'm not entirely sure why, but gathered it would around the field separator.

I tried doing this :-

Code:
oldIFS=$IFS
IFS="\n\r"

if [ ....blah

IFS=$oldIFS
.and noticed it worked correctly but the print output from awk was missing n's and r's.

Through trial and error i found setting
Code:
IFS=""
made it work.

Anyone know why?

cheers