help-make
[Top][All Lists]
Advanced

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

RE: why does command echo \\\foobar print \\foobar


From: Paul Smith
Subject: RE: why does command echo \\\foobar print \\foobar
Date: Sun, 07 Feb 2010 09:41:01 -0500

On Sun, 2010-02-07 at 06:24 -0800, Mark Galeck (CW) wrote:
> OK, let me make sure I am not confused:
> 
> Are you saying that on Unix:
> 
> >echo \\\foobar
> \foobar
> 
> And that is why you expected that?  

Yes.  Well, to be precise I expected it because I know how backslash
escaping works in the shell.

Without any quoting, the first backslash escapes the second backslash,
giving a single backslash, and the third backslash escapes the "f".
Since an escaped character is just that character, "\f" is just "f", and
the expected result is "\foobar".

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist





reply via email to

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