Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Return IFS to Space

Status
Not open for further replies.

simpson

MIS
Joined
Oct 23, 2001
Messages
58
Location
CA
Hello,

I have a (KSH) script taht interprets different input squences and processes them. The first of which is a CSV so I have set IFS to , with:

IFS=,

Now later in my script I am reading input in from a grep command and would liek to |read var1 var2 var3 ....

How do I set my IFS back to spaces. Here is what I have tried thus far:
IFS=
IFS=""
IFS=" "
IFS=''
IFS=' "

Any help would be greatly appreciated.
Mike
 
Hi

I prefer to do it this way :
Code:
oldIFS="$IFS"
IFS=','

read csv

IFS="$oldIFS"
But what you ask for would be :
Code:
IFS="`echo ' \n\t'`"

Feherke.
 
A better way is...
Code:
unset IFS
The default field separator is a space.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top