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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IFS problem

Status
Not open for further replies.

woche

Programmer
Jan 16, 2002
25
CH
hi

this seems like a simple question: HOW DO I SET THE IFS VARIABLE IN MY SCRIPT? i just can't get it to work!
i tried different things:

IFS="."
IFS=.
IFS='.'

echo $IFS # never returns what i want, just blank

but non worked. i'm trying to define ifs at the beginning of my ksh-script, then use it for the set command.

thanks
woche
 
IFS is an internal var of the shell, i don't believe you can print it, but it works

#!/bin/ksh
IFS=" "
for aaa in `ls -l`
do echo $aaa
done
vox clamantis in deserto.
 
hi

hmmm... once again one of those strange things - sometimes my idea of things is just a bit too tight :-(

well, thanks for your help!
woche
 
if you 'export IFS' i would have thought that you would be able to print/echo it ...

maybe i'm wrong though :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top