[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] (no subject)
From: |
DJ Mills |
Subject: |
Re: [Help-bash] (no subject) |
Date: |
Fri, 22 Sep 2017 12:14:03 -0400 |
On Fri, Sep 22, 2017 at 11:43 AM, John McKown <address@hidden>
wrote:
> My bad. I overlooked that. I was thinking that since I didn't do an
> "export IFS", that the variable only retained its value during the
> execution of that one line. On my system, I see:
>
> $ echo -n $IFS|od -tcx1
> 0000000
> $ IFS="-" : do nothing
> $ echo -n $IFS|od -tcx1
> 0000000
> $
>
It's different because in your example you're not actually running a
command, you're just doing two variable assignments (the command
substitution doesn't count).
Also setting IFS like that for a command won't affect the wordsplitting for
that command itself, just export the IFS value to the subprocess's
environment.
Regardless, it's a horrid, hacky way of doing it. Just quote your
expansions and be done with it
- [Help-bash] (no subject), Lakshman Siddardha, 2017/09/22
- Re: [Help-bash] (no subject), John McKown, 2017/09/22
- Re: [Help-bash] (no subject), Greg Wooledge, 2017/09/22
- Re: [Help-bash] (no subject), John McKown, 2017/09/22
- Re: [Help-bash] (no subject), Chet Ramey, 2017/09/22
- Re: [Help-bash] (no subject), John McKown, 2017/09/22
- Re: [Help-bash] (no subject), Chet Ramey, 2017/09/22
- Re: [Help-bash] (no subject), John McKown, 2017/09/22
- Re: [Help-bash] (no subject), Greg Wooledge, 2017/09/22
- Re: [Help-bash] (no subject),
DJ Mills <=
- Re: [Help-bash] (no subject), Greg Wooledge, 2017/09/22
- Re: [Help-bash] (no subject), John McKown, 2017/09/22