LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-15-2007, 09:10 PM   #16
cfaj
Member
 
Registered: Dec 2003
Location: Toronto, Canada
Distribution: Mint, Mandriva
Posts: 221

Rep: Reputation: 31

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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
dead keys, setxkbmap and upside down exclamation marks! Komakino Linux - Software 2 08-03-2010 11:16 AM
Problems with quotes and double quotes Andruha Slackware 6 01-02-2010 04:44 PM
Using single quotes vs double quotes in PHP strings vharishankar Programming 6 07-11-2005 11:41 AM
In BASH shell, what is the difference in usage between single and double quotes? davidas Linux - Newbie 2 04-05-2004 03:00 AM
Shell scripting: exclamation marks in strings Dark_Helmet Programming 9 06-16-2003 06:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration