emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quote file name args to start-process-shell-command?


From: David Kastrup
Subject: Re: Quote file name args to start-process-shell-command?
Date: Thu, 12 Oct 2006 11:27:58 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Andreas Schwab <address@hidden> writes:

> David Kastrup <address@hidden> writes:
>
>> Eli Zaretskii <address@hidden> writes:
>>
>>> For example, I just tried this:
>>>
>>>   (call-process-shell-command "ls" nil t nil "foo* bar*")
>>>
>>> and got a listing of all files that match the two wildcards `foo*' and
>>> `bar*'.
>>
>> I think that would be abuse of the command.
>
> No, it isn't.  The doc string says:
>
> "Wildcards and redirection are handled as usual in the shell."

Spaces are neither a wildcard nor a redirection.

> That implies that there shall be no quoting applied.

`shell-quote-argument' and `shell-quote-wildcard-pattern' are two
different functions.

> You need to go lower level to avoid metacharacter handling.

Straw man.  This never was about "metacharacter handling" but rather
about argument processing.

However, I agree that `shell-quote-argument' would be inappropriate to
apply on the arguments of `call-process-shell-command'.  Only those
characters responsible for splitting arguments into words should get
quoted.  That would pretty much be the subset that
`shell-quote-wildcard-pattern' uses.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]