[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: turn off word splitting for vars but keep for read
From: |
Pierre Gaston |
Subject: |
Re: RFC: turn off word splitting for vars but keep for read |
Date: |
Fri, 22 Nov 2013 21:21:14 +0200 |
On Fri, Nov 22, 2013 at 8:53 PM, Eric Blake <eblake@redhat.com> 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 example, I
> bet you have (multiple copies of) a script named install-sh somewhere on
> your system. It frequently uses word split variables, such as these
> setup lines:
>
> rmprog=${RMPROG-rm}
> ...
> rmcmd="$rmprog -f"
>
> for use in constructs like this:
> $doit $rmcmd -f "$dst" 2>/dev/null ||
>
> Disabling word splitting for an interactive shell is one thing (and in
> fact, zsh has done that in their default mode), but for scripting, you
> would break LOTS of existing scripts if you changed the default behavior
> of word splitting.
>
> --
> Eric Blake eblake redhat com +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
> well, he proposes an option to turn on these behavior, not to change the
default behaviour.
I reckon something like shopt -s autoquote_expansions could be useful
- RFC: turn off word splitting for vars but keep for read, Aleksey Midenkov, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Pierre Gaston, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Aleksey Midenkov, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Eric Blake, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read,
Pierre Gaston <=
- Re: RFC: turn off word splitting for vars but keep for read, Aleksey Midenkov, 2013/11/22
- Re: RFC: turn off word splitting for vars but keep for read, Bob Proulx, 2013/11/24
- Re: RFC: turn off word splitting for vars but keep for read, Greg Wooledge, 2013/11/25
- Re: RFC: turn off word splitting for vars but keep for read, Bob Proulx, 2013/11/25
- Re: RFC: turn off word splitting for vars but keep for read, Eduardo A . Bustamante López, 2013/11/22
Re: RFC: turn off word splitting for vars but keep for read, Greg Wooledge, 2013/11/22
Re: RFC: turn off word splitting for vars but keep for read, Peggy Russell, 2013/11/22