The generally accepted way to deal with IFS is to save the current value
and restore when done:
ifs=$IFS
IFS='
'
...
IFS=$ifs
But, of course, this is a change local to the script being run, so when
it exits, the change would be 'forgotten' anyway, since it's local to
the sub shell that was running. The only problem could be if you need
the full IFS value to process the line in some way, in the script.
Bob
Luis R Finotti wrote:
Mario 'BitKoenig' Holbe wrote:
Andras Lorincz <[EMAIL PROTECTED]> wrote:
ENTRY=3D$(cat input_file)
for I in $ENTRY
while read i; do
echo "$i"
done < input_file
regards
Mario
And if the spaces give you trouble, add
---------
IFS='
'
---------
That's just a "newline" between the single quotes. This changes the
"input field separator" to a new line and not a space. (The default is
space, tab, newline, I think.) You can change it back later if you need.
HTH,
Luis
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]