04-15-2007, 09:10 PM
|
#16
|
Member
Registered: Dec 2003
Location: Toronto, Canada
Distribution: Mint, Mandriva
Posts: 221
Rep:
|
Quote:
Originally Posted by jschiwal
I hope it isn't too late to add to this thread. There is something else to watch for when testing code by entering lines in interactively.
If you change the IFS variable, as in
IFS='
'
Then you can run into a problem with some commands because the space character in the aliases doesn't separate the command from the arguments because space isn't in IFS. I usually back up IFS and restore it after the command I need it for.
|
When testing code that changes IFS, I use a subshell:
Code:
$ (
> IFS=
> : whatever
> )
$ printf "%s" "$IFS" | od -c
0000000 \t \n
0000003
|
|
|