delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/07/18/13:00:46

X-Spam-Check-By: sourceware.org
Date: Tue, 18 Jul 2006 13:00:33 -0400 (EDT)
From: Igor Peshansky <pechtcha AT cs DOT nyu DOT edu>
Reply-To: cygwin AT cygwin DOT com
To: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder AT niaid DOT nih DOT gov>
cc: "McGraw, Robert P." <rmcgraw AT purdue DOT edu>, cygwin AT cygwin DOT com
Subject: RE: window command in bash
In-Reply-To: <31DDB7BE4BF41D4888D41709C476B65704168D0A@NIHCESMLBX5.nih.gov>
Message-ID: <Pine.GSO.4.63.0607181258540.26459@access1.cims.nyu.edu>
References: <31DDB7BE4BF41D4888D41709C476B65704168D0A AT NIHCESMLBX5 DOT nih DOT gov>
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, Buchbinder, Barry (NIH/NIAID) [E] wrote:

> McGraw, Robert P. wrote:
> > I have a window command that I want to execute in a bash script.
> >
> > In my .bat file the command is
> >
> > 	AgBackup.exe /notext c:\Alligate\agbackupfiles
> >
> > I tried to execute this command in a bash window and the command
> > works but is does not seem to recognize the parameters. The
> > "c:\alligate...." is the path where a backup is written. In the bash
> > script the backup file is written in the default location.
> [snip]
> > In a shell script what is the proper way to pass parameters to a
> > window program?
>
> A Windows program will think that /cygdrive/c/Alligate/agbackupfiles are
> options, not a path.
>
> 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"

> or
> 	AgBackup.exe /notext c:\\Alligate\\agbackupfiles
>
> You should read <http://cygwin.com/cygwin-ug-net/using-effectively.html>
> in the Cygwin User's Guide <http://cygwin.com/cygwin-ug-net/>, and
> especially
> <http://cygwin.com/cygwin-ug-net/using-effectively.html#id4735437>.

HTH,
	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