Re: Spaces in args, escapes, and command substitution

2006-10-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to [EMAIL PROTECTED] on 10/28/2006 10:19 PM: >> That's because `` and $() have different syntax, as required by POSIX. >> You should just do $(basename "$f1"), rather than $(basename \"$f1\"). >> > > That's crazy! > > You have nested double

Re: Spaces in args, escapes, and command substitution

2006-10-28 Thread bash
> >According to [EMAIL PROTECTED] on 10/28/2006 9:42 PM: >> f1="/a/b/a-000" >> f2="/a/b/c d-000" >> touch "a-000.ext" >> touch "c d-000.ext" >> >> for file in "$(basename \"$f1\")"*.ext "$(basename \"$f2\")"*.ext >> do >> echo "one=$file" >> done >> >> for fil

Re: Spaces in args, escapes, and command substitution

2006-10-28 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to [EMAIL PROTECTED] on 10/28/2006 9:42 PM: > f1="/a/b/a-000" > f2="/a/b/c d-000" > touch "a-000.ext" > touch "c d-000.ext" > > for file in "$(basename \"$f1\")"*.ext "$(basename \"$f2\")"*.ext > do > echo "one=

Re: Spaces in args, escapes, and command substitution

2006-10-28 Thread bash
> >Word splitting is controlled by IFS. Use IFS=$'\n' to only split on >newlines. > >Andreas. Well, I still dont see any examples. I don't think it is possible even using IFS. Even if it does work somehow, it isn't easy or intuitive. But there is worse. Try and run the following script: