[Top][All Lists]

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

Re: [Help-bash] pass command to script

From: Chet Ramey
Subject: Re: [Help-bash] pass command to script
Date: Fri, 26 Apr 2019 11:08:49 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

On 4/26/19 10:48 AM, Warlich, Christof wrote:

> Now let's assume we had some nestable quoting mechanism similar to the
> already suggested $[...]. Then, escaping would not be necessary at all, 
> right?:
> $ bash -c $[echo "hi"]  
> hi
> $ bash -c $[bash -c $[echo "hi"]]
> hi
> $ bash -c $[bash -c $[bash -c $[echo "hi"]]]
> hi
> Passing _such_ a command line to a script would merely require to wrap this
> command with another $[...] without the need to modify anything _inside_
> that command line!

You're just introducing another quoting character with slightly different
semantics that requires a separate escaping mechanism (and $[] is not
available, as previously noted).

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden

reply via email to

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