Skip to Content.
Sympa Menu

sm-sorcery - Re: [SM-Sorcery]handling of $IFS

sm-sorcery AT lists.ibiblio.org

Subject: Discussion of Sorcery related topics

List archive

Chronological Thread  
  • From: Nick Jennings <nkj AT namodn.com>
  • To: sm-sorcery AT lists.ibiblio.org
  • Subject: Re: [SM-Sorcery]handling of $IFS
  • Date: Thu, 17 Oct 2002 22:10:33 -0700

On Fri, Oct 18, 2002 at 12:31:03AM -0400, Sergey A. Lipnevich wrote:
> You seem to be missing my point. It's not /my/ code that I'm talking
> about, it's sorcery. And your solution does not work for 100% cases, as
> I have described below. It worked about four days ago for this part of
> code, then something's got changed, and it doesn't work anymore. Sorcery
> will keep bumping into $IFS whenever new code is introduced. If for
> instance awk can't be used to call a bash function, or some other way is
> invented to deal with this, I'd say $IFS will become a constant
> nightmare, as it happened to Nick ;-).
>
> E.g., consider this pice (takes place in libdepends):
>
> save_ifs=$IFS
> $IFS=$enter_ifs
> for i in file-with-lines-with-spaces; do
> $IFS=$save_ifs
> do stuff
> done
> $IFS=$save_ifs
>
> Isn't it a bad hack?
> One thing is clear from your answer: there's no way to reset $IFS to
> whatever we need and keep it this way. So I'd say we try and find the
> way to never touch $IFS at all, if at all possible.
>

I agree, but I think the alternatives are even more gritty...
At least, the alternatives we've explored.





Archive powered by MHonArc 2.6.24.

Top of Page