Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
say a file called "original" contains the following entries:
qwerty
A space
12345
secret
rm-rf*
/hello337
byehdi(#note:there's a space)and i want to grab all the characters in those lines, including those special characters like / and space(the last 2 lines).
i set IFS to \n at the beginning of my script.
Like this:
IFS=''and now everything's fine.
my question is:
do i need to set IFS back to its default value at the end of my script, which includes space,tab and new line? if i don't reset IFS to the default value, will other scripts be unable to use space and tab as separators?Thanks a lot
Anthony

No,
when the script is run, the shell forks another shell which then executes the script. Thus, this parameter is not passed to the parent shell.Also, since you did not export the variable, it will not be passed to other scripts if they are called by the main script.
-jim

Thanks so much!
just curious, if i do want to export the variable so that other scripts can use it, what should i do? I mean which command should i use?
Thanks again
Anthony

![]() |
log file script
|
anyone using Teco?
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |