[Top][All Lists]

[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 12:45:43 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> Cc: Lennart Borgman <address@hidden>,  address@hidden
>> From: David Kastrup <address@hidden>
>> Date: Thu, 12 Oct 2006 09:44:14 +0200
>> >   Remaining arguments are strings passed as additional arguments
>> >   for COMMAND.
>> >
>> > There's no requirement here that each one of the "&rest ARGS" be a
>> > separate command-line argument, is there?
>> Then it would be completely pointless to allow several ARGS.
> It's not pointless, it can be useful if the command line is
> generated piecewise.  start-process-shell-command is not system(3).

Then the question is why it should behave like it.

The code says:

(defun start-process-shell-command (name buffer &rest args)
  "Start a program in a subprocess.  Return the process object for it.


Remaining arguments are the arguments for the command.
Wildcards and redirection are handled as usual in the shell.


   ((eq system-type 'vax-vms)
    (apply 'start-process name buffer args))
   ;; We used to use `exec' to replace the shell with the command,
   ;; but that failed to handle (...) and semicolon, etc.
    (start-process name buffer shell-file-name shell-command-switch
                   (mapconcat 'identity args " ")))))

Clearly, ARGS is (except on VMS) _not_ a list of separate arguments,
but rather strings pasted together with spaces.

So I don't understand how to apply your remark
"start-process-shell-command is not system(3).".
`start-process-shell-command' certainly is coded in a manner that
_strongly_ suggests it to be quite close to system(3) which is
documented as

        #include <stdlib.h>

        int system(const char *command);

        system() executes a command  specified in command by calling
        /bin/sh -c  command, and returns after the  command has been
        completed.  During execution of the command, SIGCHLD will be
        blocked, and SIGINT and SIGQUIT will be ignored.

David Kastrup, Kriemhildstr. 15, 44793 Bochum

reply via email to

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