X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: window command in bash Date: Tue, 18 Jul 2006 14:11:50 -0400 Message-ID: <31DDB7BE4BF41D4888D41709C476B65704168D1A@NIHCESMLBX5.nih.gov> In-Reply-To: From: "Buchbinder, Barry \(NIH/NIAID\) [E]" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k6IIC23q009156 Igor Peshansky wrote: > 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" > 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 >> or >> AgBackup.exe /notext c:\\Alligate\\agbackupfiles >> >> You should read >> >> in the Cygwin User's Guide , and >> especially >> . > > HTH, > Igor -- 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/