This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: window command in bash


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@cs.nyu.edu | igor@watson.ibm.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]