[NTLUG:Discuss] What scripting change do I need to make?
Leroy Tennison
leroy.tennison at verizon.net
Tue Oct 6 21:56:59 CDT 2015
I thought about eval but couldn't get it to work, I noticed though that
you made another change: $(seq -s, 1 3) rather than `seq -s, 1 3`.
Tested and that works too, thanks.
On 10/06/2015 12:38 AM, Christopher Cox wrote:
> On 10/05/2015 11:07 PM, Patrick R. Michaud wrote:
>>
>> On Mon, Oct 05, 2015 at 09:46:08PM -0500, Leroy Tennison wrote:
>>> If only there was a way to tell mkdir "this isn't a string!".
>>
>> It's important to note that mkdir(1) itself never sees quotes, braces,
>> or anything like that -- all of these expansions and substitutions
>> are handled by the shell *before* the mkdir command is ever called.
>>
>> So, according to the bash(1) man page ("EXPANSIONS"):
>>
>> The order of expansions is: brace expansion; tilde expansion,
>> parameter
>> and variable expansion, arithmetic expansion, and command
>> substitution
>> (done in a left-to-right fashion); word splitting; and pathname
>> expansion.
>>
>> Thus, in the case of
>>
>> mkdir -p test/{`seq -s, 1 3`}
>
> eval is your friend
>
> eval mkdir -p test/{$(seq -s, 1 3)}
>
>
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss
>
More information about the Discuss
mailing list