delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/18/16:52:27

X-Spam-Check-By: sourceware.org
Date: Tue, 18 Jul 2006 16:52:12 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: window command in bash
In-Reply-To: <e9jgmh$d5q$1@sea.gmane.org>
Message-ID: <Pine.GSO.4.63.0607181647161.26459@access1.cims.nyu.edu>
References: <Pine DOT GSO DOT 4 DOT 63 DOT 0607181258540 DOT 26459 AT access1 DOT cims DOT nyu DOT edu> <31DDB7BE4BF41D4888D41709C476B65704168D1A AT NIHCESMLBX5 DOT nih DOT gov> <e9jgmh$d5q$1 AT sea DOT gmane DOT org>
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Tue, 18 Jul 2006, mwoehlke wrote:

> Buchbinder, Barry (NIH/NIAID) [E] wrote:
> > Igor Peshansky wrote:
> > > On Tue, 18 Jul 2006, Buchbinder, Barry (NIH/NIAID) [E] wrote:
> > > > Did you quote the path or escape the backslashes to protect the
> > > > backslashes from the shell interpreting them as escape characters?
> > > > 	E.g., AgBackup.exe /notext 'c:\Alligate\agbackupfiles'
> > > > or
> > > > 	AgBackup.exe /notext "c:\Alligate\agbackupfiles"
> > > A minor correction: you still need to escape the backslashes when
> > > using double quotes, so the right way is
> > > 	AgBackup.exe /notext "c:\\Alligate\\agbackupfiles"
> >
> > Here's what bash does:
> >
> > /c> echo  "c:\Alligate\agbackupfiles"
> > c:\Alligate\agbackupfiles
> >
> > Maybe if one has a variable following the backslash:
> >
> > /c> echo "xyz\$USER"
> > xyz$USER
> > /c> echo "xyz\\$USER"
> > xyz\BBuchbinder

'PAGER="less +/QUOTING" man bash'.

> I think the point is that "\\" is ALWAYS safe, whereas "\?" (where "?"
> is some character) may not be.

Exactly.  Case in point: UNC paths.  Both "\\machine\share" and
"\machine\share" will refer to the string '\machine\share'.  To really
reference a UNC path, you'll need to say "\\\\machine\\share".  So why not
double the backslashes anyway and save yourself the confusion?
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_	    pechtcha AT cs DOT nyu DOT edu | igor AT watson DOT ibm DOT com
ZZZzz /,`.-'`'    -.  ;-;;,_		Igor Peshansky, Ph.D. (name changed!)
     |,4-  ) )-,_. ,\ (  `'-'		old name: Igor Pechtchanski
    '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!

"Las! je suis sot... -Mais non, tu ne l'es pas, puisque tu t'en rends compte."
"But no -- you are no fool; you call yourself a fool, there's proof enough in
that!" -- Rostand, "Cyrano de Bergerac"

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019