[Discuss] bash problem
pw
p.willis at telus.net
Thu Aug 16 16:00:09 PDT 2007
Rajiv Khaneja wrote:
> Your problem is with this line
> "for DIR in `find -type d`; do"
>
> The out put of find is being tokenized by space and newlines... so with the
> directory "foo bar" DIR is being set to foo first then on the next
> iteration bar.
>
> I think you can do something like
>
> IFS=$'\n'
>
> and bash will only tokenize on new lines.
>
>
>
> Other than that I can't think of anything... I find it easier to just use
> perl instead of dealing with bash string manipulation
>
You're right. IFS! Of course!
Thank you
Peter
More information about the Discuss
mailing list