This is the mail archive of the
mailing list for the Cygwin project.
Re: Multiple backslashes
- From: Randall R Schulz <rrschulz at cris dot com>
- To: Dmitry Bely <dbely at mail dot ru>, cygwin at cygwin dot com
- Date: Sun, 10 Feb 2002 09:14:00 -0800
- Subject: Re: Multiple backslashes
Apart from the fact that this question involves Windows native path name
syntax (which, by the way, works equally well with forward slashes), this
is not Cygwin-specific.
There are two levels or rounds of interpretation of your command string.
The first is applied by the shell that interpets the command you mentioned.
Then the bash invoked by that command interprets the argument to the "-c"
option. Each of these rounds of interpretation replaces "\\" with "\".
If you use "hard" quotes (apostrophes) then you'll only need two backslashes.
If you use forward slashes (and CMD.exe is not going to be involved), then
you'll only need quoting to handle spaces and shell globbing metacharacters
(i.e., '*', '?' or '[') and syntactically significant characters (e.g., '('
Mountain View, CA USA
At 08:45 2002-02-10, Dmitry Bely wrote:
>This is probably a FAQ, but can you explain me why
>bash -c "ls c:\\\\"
>requires 4 backslashes? I can understand why 2 BS is needed, but 4 BS IMHO
>are too much :-)
>Hope to hear from you soon,
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html