From: "Laimonas Vėbra" <laimonas.vebra@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 6784@debbugs.gnu.org
Subject: bug#6784: 24.0.50; cmdproxy incosistency with command pathnames
Date: Wed, 04 Aug 2010 13:28:58 +0300 [thread overview]
Message-ID: <4C5940EA.7030301@gmail.com> (raw)
In-Reply-To: <83k4o7xefq.fsf@gnu.org>
Eli Zaretskii wrote:
>> Laimonas Vėbra wrote:
>>
>>> <...>
>>
>> Works:
>> cmd.exe /c c:/cygwin/bin/ls | grep foo
>> cmd.exe /c c:/cygwin/bin/ls | C:\cygwin\bin\grep foo
>> cmd.exe /c c:/cygwin/bin/ls | "C:/cygwin/bin/grep" foo
>> cmd.exe /c "c:/cygwin/bin/ls" | "C:/cygwin/bin/grep" foo
>>
>> Fails:
>> cmd.exe /c c:/cygwin/bin/ls | C:/cygwin/bin/grep foo
> In the case in point, the problem was with the executable _before_
> the pipe.
Or with subsequent _slashed_ _and_ _unquoted_ executable(s).
Quote whole command line (with slashed programs/paths single quoted):
M-x shell-command
""c:/cygwin/bin/ls" | grep foo"
M-x shell-command
""c:/cygwin/bin/ls" | "c:/cygwin/bin/grep" foo"
or:
cmdproxy -c """c:/cygwin/bin/ls" | grep o""
cmdproxy -c """c:/cygwin/bin/ls" | "c:/cygwin/bin/grep" o""
and it _works_.
cmd /?:
If /C or /K is specified, then the remainder of the command line after
the switch is processed as a command line, where the following logic is
used to process quote (") characters:
1. If all of the following conditions are met, then quote
characters on the command line are preserved:
- no /S switch
- exactly two quote characters
- no special characters between the two quote characters,
where special is one of: &<>()@^|
- there are one or more whitespace characters between the
the two quote characters
- the string between the two quote characters is the name
of an executable file.
2. Otherwise, old behavior is to see if the first character is
a quote character and if so, strip the leading character and
remove the last quote character on the command line, preserving
any text after the last quote character.
prev parent reply other threads:[~2010-08-04 10:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-03 15:56 bug#6784: 24.0.50; cmdproxy incosistency with command pathnames Óscar Fuentes
2010-08-03 17:21 ` Eli Zaretskii
2010-08-03 17:52 ` Óscar Fuentes
2010-08-03 18:15 ` Eli Zaretskii
2010-08-03 18:19 ` Laimonas Vėbra
2010-08-03 19:28 ` Eli Zaretskii
2010-08-03 20:15 ` Laimonas Vėbra
2010-08-03 20:57 ` Laimonas Vėbra
2010-08-04 3:08 ` Eli Zaretskii
2010-08-04 10:28 ` Laimonas Vėbra [this message]
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=4C5940EA.7030301@gmail.com \
--to=laimonas.vebra@gmail.com \
--cc=6784@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.