emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add shell-quasiquote.


From: Wolfgang Jenkner
Subject: Re: [PATCH] Add shell-quasiquote.
Date: Thu, 22 Oct 2015 15:09:11 +0200
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (berkeley-unix)

On Thu, Oct 22 2015, Jeff Clough wrote:

> While dash is a variant of a variant of the Bourne shell, can we
> say with reasonable certainty that those variations don't impact
> shell-quote-argument?

That a backslash quotes any following character (except newlines) seems
to be true since the Thompson shell, cf.

http://v6shell.org/

I've played around a bit with (the FreeBSD port of) sh6 from the site
above using

(defun test--shell-quote-argument (arg &optional shell)
  (let* ((shell-file-name (or shell shell-file-name))
         (qarg (shell-quote-argument arg))
         (cmd (format "printf %%s %s" qarg))
         (res (shell-command-to-string cmd)))
    (list (string-equal arg res) arg qarg res)))


The only problem seems to be with newlines, unsurprisingly:

(test--shell-quote-argument "\n" "sh6")

==> (nil "
" "'
'" "syntax error
")



reply via email to

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