unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Rodgers <ihs_4664@yahoo.com>
Subject: Re: Dired shell command on file asymchronously
Date: Fri, 24 Jun 2005 15:19:22 -0600	[thread overview]
Message-ID: <d9ht0j$v45$1@sea.gmane.org> (raw)
In-Reply-To: <wtpll4zsla1.fsf@uhu.mchp.siemens.de>

Josef.Bauer.NOSPAM@web.de wrote:
 > I just found that I added a minor improvement in the meantime. Using
 > 'shell-quote-argument' file names with spaces and such are working.
 >
 > Here is the new version:
 >
 > ;-----------------------------------------------------------------
 > (defun dired-do-shell-command-in-background (command)
 >   "In dired, do shell command in background on the file or directory 
named on this line."
 >   (interactive
 >    (list (dired-read-shell-command (concat "& on " "%s: ") nil (list 
(dired-get-filename)))))
 >   (call-process command nil 0 nil (shell-quote-argument 
(dired-get-filename))))

That doesn't make sense to me.  call-process passes its &rest ARGS
directly to PROGRAM, without any word-splitting etc. by the shell.  So
shell-quote-argument is unecessary, and in fact could introduce quoting
characters that would be interpreted as part of the file name.

If COMMAND is actually a shell command (i.e. with redirection operators
etc.) then you must use shell-command instead of call-process.  If it is
just a program, then using call-process is fine -- but again, using
shell-quote-argument with it is not.

-- 
Kevin Rodgers

  reply	other threads:[~2005-06-24 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1007.1119560755.2857.help-gnu-emacs@gnu.org>
2005-06-24 12:59 ` Dired shell command on file asymchronously Josef.Bauer.NOSPAM
     [not found]   ` <mailman.1102.1119633137.2857.help-gnu-emacs@gnu.org>
2005-06-24 17:43     ` Josef.Bauer.NOSPAM
2005-06-24 21:19       ` Kevin Rodgers [this message]
     [not found]       ` <mailman.1131.1119648589.2857.help-gnu-emacs@gnu.org>
2005-06-27 12:54         ` Josef.Bauer.NOSPAM
2005-06-24 18:10   ` Luis O. Silva
2005-06-24 13:06 ` asymchronously Dan Elliott
2005-06-24 18:17   ` asymchronously Luis O. Silva
2005-06-23 22:13 Dired shell command on file asymchronously Luis O. Silva
2005-06-24 11:42 ` Emilio Lopes

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='d9ht0j$v45$1@sea.gmane.org' \
    --to=ihs_4664@yahoo.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).