unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "R. Diez" <rdiezmail-emacs@yahoo.de>
To: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: shell-quote-argument escapes '='
Date: Fri, 24 Apr 2020 12:35:51 +0000 (UTC)	[thread overview]
Message-ID: <1235716199.473564.1587731751300@mail.yahoo.com> (raw)
In-Reply-To: 1235716199.473564.1587731751300.ref@mail.yahoo.com

Hallo all:

I am running a self-compiled Emacs version 26.2 on Ubuntu 18.04.4 LTS. I normally use Bash as a shell.

When I evaluate the following in Emacs:

  (shell-quote-argument "a=b")

I get:

  "a\\=b"

That's wrong, because it does not work in Bash:

  $ echo "a\\=b"
  a\=b

But even if I am getting confused with Emacs' string escaping, echo "a\=b" does not work either.

I am looking for the equivalent in Emacs for Bash' printf "%q" escaping/quoting:

  $ printf "%q" "a=b"
  a=b

I though I might just copy and modify shell-quote-argument, but it is too complicated for my limited Lisp skills.

I do not need any flexibility or configuration, I just need to emulate the behaviour of Bash' printf "%q".

Thanks in advance for any help,
  rdiez



       reply	other threads:[~2020-04-24 12:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1235716199.473564.1587731751300.ref@mail.yahoo.com>
2020-04-24 12:35 ` R. Diez [this message]
2020-04-24 13:28   ` shell-quote-argument escapes '=' Stefan Monnier
2020-04-24 16:13     ` Philipp Stephani

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=1235716199.473564.1587731751300@mail.yahoo.com \
    --to=rdiezmail-emacs@yahoo.de \
    --cc=help-gnu-emacs@gnu.org \
    /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).