On Wed, Feb 4, 2015 at 5:31 PM, Ray Andrews <rayandrews@xxxxxxxxxxx
<mailto:rayandrews@xxxxxxxxxxx>> wrote:
On 02/04/2015 03:47 PM, Lawrence Velázquez wrote:
% echo - -
Ok, the first hyphen gets eaten, and the next one is literal.
Still, shouldn't
single quotes make anything inside them literal?
The single-quotes simply inhibit the shell from performing any
substitutions (e.g., of $var references) inside the quoted string. The
quotes also inhibit splitting the string on $IFS boundaries; i.e., the
shell will pass the resulting string as a single argument to the
command. The echo command simply gets a hyphen whether or not you
quoted it. The echo command has no way of knowing that it was
originally enclosed in single-quotes.