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: Eli Zaretskii
Subject: Re: Quote file name args to start-process-shell-command?
Date: Thu, 12 Oct 2006 06:54:57 -0400

> Cc: Eli Zaretskii <address@hidden>,
>         Lennart Borgman <address@hidden>,
>         address@hidden
> From: David Kastrup <address@hidden>
> Date: Thu, 12 Oct 2006 11:27:58 +0200
> 
> 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.

What about < and | and ` and ' and ~ and ! etc.?  Some, if not all of
them also split arguments into words, and have other effects.  We
should leave this to the shell.

Let's put it another way: an interface to invoking a shell eventually
boils down to calling `system' or its equivalent.  A call to `system'
accepts a single string that is the command line to pass to the shell.
So any API wrapped around `system' eventually concatenates all the
portions of the command-line args into a single string, and that is
how applications should use such an API.

If one needs to pass several strings as separate arguments to a
subprogram (including a shell), one should use an appropriate API,
such as call-process.




reply via email to

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