help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Brace expansion with empty args


From: Roman Rakus
Subject: Re: [Help-bash] Brace expansion with empty args
Date: Fri, 14 Jun 2013 14:57:49 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130311 Thunderbird/17.0.4

On 06/14/13 14:32, Greg Wooledge wrote:
That's not correct.  There's no word splitting of the results.
I think it is correct, but maybe we didn't understand each other.

imadev:~$ printf '<%s> ' {,c}; echo
so two steps:
1) {,c} converted to <null string> and c separated by space
2) <null string> c undergo word splitting and result is: c
<c>
Here you see it
imadev:~$ printf '<%s> ' ''{,c}; echo
1) ''{,c} converted to: ''<null string> and ''c
2) ''<null string> converted to <empty string>, ''c converted to <c>
<> <c>
that's it
imadev:~$ printf '<%s> ' ' '{,c}; echo
1) ' '{,c} -> ' '<null> and ' 'c
2) ' '<null> -> <space>, ' 'c -> <space>c
< > < c>
correct
imadev:~$ printf '<%s> ' 'a '{,c}; echo
<a > <a c>
Similar as above
reference: http://www.gnu.org/software/bash/manual/bashref.html#Shell-Expansions

however, maybe the brace expansion really doesn't undergo word splitting, it is not mentioned on http://www.gnu.org/software/bash/manual/bashref.html#Word-Splitting

feel free to correct me

RR



reply via email to

[Prev in Thread] Current Thread [Next in Thread]