On 11/22/13, 9:22 AM, Clint Hepner wrote:
> Bash Version: 4.2
> Patch Level: 45
> Release Status: release
>
> Description:
>
> An unquoted parameter expansion in a here string does not seem to
> conform with my understanding of how
> read works with a local IFS override. Persona
> ...
> $ IFS=""
> $ f() { echo $1; }; x="a b c"; f $x
> a b c
>
> But, IFS influences `read`, which of course benefits from word
> splitting. In light of that conflict, I propose two possible
> solutions:
>
> 1: shopt -s unsplit_vars
>
> which will turn off word splitting for var expansion.
>
On Nov 22, 2013, at 10:04 AM, Pierre Gaston wrote:
>
>
>
> On Fri, Nov 22, 2013 at 4:22 PM, Clint Hepner wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i386
> OS: darwin13.0.0
> Compiler: clang
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='
On Fri, Nov 22, 2013 at 11:21 PM, Pierre Gaston wrote:
>
>
>
> On Fri, Nov 22, 2013 at 8:53 PM, Eric Blake wrote:
>>
>> On 11/22/2013 10:36 AM, Aleksey Midenkov wrote:
>>
>> > But nevertheless, I still find my proposal usable (since word
>> > splitting for vars is unlikely to be usable in scripts
On Fri, Nov 22, 2013 at 8:53 PM, Eric Blake wrote:
> On 11/22/2013 10:36 AM, Aleksey Midenkov wrote:
>
> > But nevertheless, I still find my proposal usable (since word
> > splitting for vars is unlikely to be usable in scripts).
>
> Scripts use word splitting on variables ALL the time. For exam
> Yes, I know, I'd ever done alias for `read`:
>
> IFS=""
> shopt -s expand_aliases
> alias read='IFS=" " read'
Why do you obfuscate your code with aliases? These just make
debugging issues with your code harder. Remembering to quote
variables and use a localized IFS for read is easier, than
intro
On 11/22/2013 10:36 AM, Aleksey Midenkov wrote:
> But nevertheless, I still find my proposal usable (since word
> splitting for vars is unlikely to be usable in scripts).
Scripts use word splitting on variables ALL the time. For example, I
bet you have (multiple copies of) a script named install
On Fri, Nov 22, 2013 at 7:07 PM, Pierre Gaston wrote:
>
>
>
> On Fri, Nov 22, 2013 at 8:00 AM, Aleksey Midenkov wrote:
>>
>> Since word splitting in vars is used not more frequently than never,
>> protecting all vars in scripts with double quotes is quite unpleasant
>> thing. Therefore, I want ex
On Fri, Nov 22, 2013 at 10:00:28AM +0400, Aleksey Midenkov wrote:
> 1: shopt -s unsplit_vars
>
> which will turn off word splitting for var expansion.
Basically, you want zsh.
On Fri, Nov 22, 2013 at 8:00 AM, Aleksey Midenkov wrote:
> Since word splitting in vars is used not more frequently than never,
> protecting all vars in scripts with double quotes is quite unpleasant
> thing. Therefore, I want exactly this behavior always to be in my
> scripts:
>
> $ IFS=""
> $ f
On Fri, Nov 22, 2013 at 4:22 PM, Clint Hepner wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i386
> OS: darwin13.0.0
> Compiler: clang
> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
> -DCONF_OSTYPE='darwin13.0.0' -DCONF_MACHTYPE='i386-apple
Since word splitting in vars is used not more frequently than never,
protecting all vars in scripts with double quotes is quite unpleasant
thing. Therefore, I want exactly this behavior always to be in my
scripts:
$ IFS=""
$ f() { echo $1; }; x="a b c"; f $x
a b c
But, IFS influences `read`, whic
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: darwin13.0.0
Compiler: clang
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='darwin13.0.0' -DCONF_MACHTYPE='i386-apple-darwin13.0\
.0' -DCONF_VENDOR='apple'
-DLOCALEDIR='/usr/local/Ce
13 matches
Mail list logo