Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: OPTARG not being set?



On Feb 3, 12:03am, Bart Schaefer wrote:
} Subject: Re: OPTARG not being set?
}
} If instead you said $(echo "echo \${$(echo ${bob})}"), then the \$ is not
} converted into bare $, and the string becomes "echo \${joe}", and the
} result of the whole expression is
} 
} 	${joe}

One point of additional clarity:  As I said, the \$ is not converted to $
when the outer $(echo ...) is parsed; but $(echo ${bob}) is substituted
when the quoted string is parsed, which is how it becomes "echo \${joe}".
Then, although the backslash is then finally stripped, the $ becomes a
quoted character (because of appearing inside quotes), and is thus not
lexed as the start of a substitution when the string produced by the outer
$(echo ...) is finally executed.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com




Messages sorted by: Reverse Date, Date, Thread, Author