From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17917 invoked by alias); 7 Feb 2002 11:17:40 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 17791 invoked from network); 7 Feb 2002 11:17:32 -0000 Received: from unknown (HELO syntrex.com) (80.18.91.202) by sources.redhat.com with SMTP; 7 Feb 2002 11:17:32 -0000 Received: (qmail 9207 invoked by uid 8); 7 Feb 2002 12:18:11 -0000 Received: from 212-41-210-71.adsl.galactica.it (212.41.210.71, claiming to be "syntrex.com") by mail.syntrex.com with SMTP id smtpdORgnTu; Thu, 07 Feb 2002 07:18:04 EST Message-ID: <3C62623E.9040907@syntrex.com> Date: Thu, 07 Feb 2002 03:17:00 -0000 From: Pavel Tsekov User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) Gecko/20011126 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Richard Gilbert CC: cygwin@cygwin.com Subject: Re: Passing double quotes to DOS References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00316.txt.bz2 Richard Gilbert wrote: > I need to be able to pass double quotes to a program running under NT4/DOS > but I cannot find a way of doing so. To illustrate the problem I have > written a trivial BAT file called e.bat which contains the single line > > echo %1 > > If I run it from a DOS shell with a double quoted parameter it echoes the > parameter with the double quotes intact, e.g. > > C:>e.bat "abc" > C:>echo "abc" (<-- the BAT file echoes the command) > "abc" > > However, if I run this program from a bash shell (or tcsh) in the cygwin > environment, I cannot find a way of passing the double quotes to the > program... > > $ e.bat "abc" > C:>echo abc > abc > > (as expected) > > $ e.bat "\"abc\"" > C:>echo "\"abc\"" > echo "\"abc\"" > > $ e.bat '"abc"' > C:>echo "\"abc\"" > echo "\"abc\"" I dont understand the output of the last example ? Is it really the same like the output of the second sample or it's just copy and paste mistake ? (DISCLAIMER: My understanding of shell scripts is not that deep so if I'm asking something very stupid here, please ignore it) > Note that both the last two result in the same command being passed to > the BAT file. > > Can anybody tell me how to do it? Does this help: e.bat \"abc\" -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/