Greg Wooledge wrote:
> Bob Proulx wrote:
> > Aleksey Midenkov wrote:
> > > rmcmd="$rmprog -f"
> > >
> > > Because it will fail for files with spaces.
> >
> > I am sure we disagree but I don't consider making rm program names
> > have spaces to be reasonable. :-/
> >
> > What would it be? "remo
On Sun, Nov 24, 2013 at 08:41:46PM -0700, Bob Proulx wrote:
> Aleksey Midenkov wrote:
> > rmcmd="$rmprog -f"
> >
> > Because it will fail for files with spaces.
>
> I am sure we disagree but I don't consider making rm program names
> have spaces to be reasonable. :-/
>
> What would it be? "rem
Aleksey Midenkov wrote:
> I would say, that this style generally is wrong:
>
> rmprog=${RMPROG-rm}
> rmcmd="$rmprog -f"
>
> Because it will fail for files with spaces.
I am sure we disagree but I don't consider making rm program names
have spaces to be reasonable. :-/
What would it be? "remov
> ...
> $ 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 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
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
12 matches
Mail list logo