public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Pavel Tsekov <ptsekov@syntrex.com>
To: Richard Gilbert <R.Gilbert@sheffield.ac.uk>
Cc: cygwin@cygwin.com
Subject: Re: Passing double quotes to DOS
Date: Thu, 07 Feb 2002 03:17:00 -0000	[thread overview]
Message-ID: <3C62623E.9040907@syntrex.com> (raw)
In-Reply-To: <Pine.WNT.4.43.0202071041550.-70797-100000@jrgilbert.shef.ac.uk>



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/

  reply	other threads:[~2002-02-07 11:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-07  2:48 Richard Gilbert
2002-02-07  3:17 ` Pavel Tsekov [this message]
2002-02-07  3:30   ` Richard Gilbert
2002-02-07  8:21     ` Pavel Tsekov
     [not found] <CA+Ni7jNBd0WZu37OMiPEyvxwkgvYnDfonKoLjpuvNrZ95A9Rbw@mail.gmail.com>
2015-05-03 20:06 ` Пётр Б.
2015-05-03 20:10   ` Пётр Б.
2015-05-03 20:11     ` Пётр Б.
2015-05-03 20:21 ` Пётр Б.
2015-05-05 14:47   ` cyg Simple

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3C62623E.9040907@syntrex.com \
    --to=ptsekov@syntrex.com \
    --cc=R.Gilbert@sheffield.ac.uk \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).