bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: wildcards in call-process


From: Kai Großjohann
Subject: Re: wildcards in call-process
Date: 27 Feb 2001 16:37:48 +0100
User-agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/21.0.99

On Tue, 27 Feb 2001, dajo@frii.com wrote:

> ;; If you execute either of the commands below in the shell, it works; the
> ;; lisp does not.  Buffer look contains one of the messages, according to
> ;; whether or not you use shell-quote-argument.

Note that in the shell command, the SHELL does the wildcard expansion.
When you use call-process, there is no shell involved, and hence no
wildcard expansion.

That is, when you type "mv * /tmp" then the shell will process this
command with wildcard expansion, giving, say, "mv a b c /tmp".  And then
the `mv' program will be executed with the four arguments `a', `b', `c',
and `/tmp'.

>From Lisp, you can do (shell-command "mv * /tmp") to get the effect you
want, or maybe

(call-process "mv" ... "/bin/sh" ... "-c" "mv * /tmp")

This is the same as doing the following from the shell:

/bin/sh -c 'mv * /tmp'

So, to make a long story short, it's not a bug.

kai
-- 
Be indiscrete.  Do it continuously.



reply via email to

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