X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Message-ID: <883284.86806.qm@web30204.mail.mud.yahoo.com> Date: Tue, 8 Sep 2009 20:30:13 -0700 (PDT) From: "Ziser, Jesse" Subject: syntax for Cygwin bash invoking Win apps To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Hello list, When I type a command in bash to invoke a Windows application (like cmd.exe= , for example), I can't seem to find a pattern in the Windows command line = that actually gets executed.=A0 Ordinary bash syntax does not seem to apply= in general when the command is a Windows app, but rather, sometimes specia= l characters are interpreted in a bash-like way, and sometimes not.=A0 So, = I'm wondering what determines whether a quote mark or something gets interp= reted or passed on. Here are some examples: $ cmd /c echo "/?" Displays messages, or turns command-echoing on or off. =A0 ECHO [ON | OFF] =A0 ECHO [message] Type ECHO without parameters to display the current echo setting. # OK, so I'm getting the Windows echo, not the bash echo.=A0 Good. # Moving on... $ cmd /c echo abc abc $ cmd /c echo "abc" abc $ cmd /c echo "\"abc\"" "\"abc\"" # Wahhh?! Anyone who knows the explanation would make me very grateful.=A0 I've tried= this with other Windows apps too, and the same weirdness seems to occur. On a related note, I've noticed what appears to be an automatic sort of hal= f-bash invocation (but not quite?) or something when I run Cygwin commands = from cmd.exe.=A0 For example, > c:\cygwin\bin\echo hi hi > c:\cygwin\bin\echo "hi" hi > c:\cygwin\bin\echo "\"hi\"" "hi" > c:\cygwin\bin\echo * myfile myotherfile yetanotherfile ... And yet... > c:\cygwin\bin\echo $PATH $PATH What the heck is going on?=A0 Are there any rules here at all?=A0 Sorry if = I'm missing something dumb.=A0 And sorry for apologizing for it.=A0 And....= .. Thanks in advance, Jesse -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple