[mdlug] Evil eval
Jeff Hanson
jhansonxi at gmail.com
Fri Oct 3 22:31:36 EDT 2014
Those worked also but I've switched to using curlys.
On Fri, Oct 3, 2014 at 9:05 PM, Michael Corral <micorral at comcast.net> wrote:
> 2014-10-01, Monsieur Jeff Hanson a ecrit:
>
>> echo "Quotes first, escapes second:"
>> for varname in test1a test1b test1c; do
>> eval echo "$varname""_lc: \$$varname\_lc"
>> done
>>
>
> Try this:
>
> echo "Quotes first, escapes second:"
> for varname in test1a test1b test1c; do
> eval echo "$varname\_lc:" \$$varname\_lc
> done
>
>
> echo "Escapes both:"
>> for varname in test1a test1b test1c; do
>> eval echo "$varname\_lc: \$$varname\_lc"
>> done
>>
>
> Try this:
>
> echo "Escapes both:"
> for varname in test1a test1b test1c; do
> eval echo $varname\_lc: \$$varname\_lc
> done
>
>
>
> Michael
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug
>
More information about the mdlug
mailing list