all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* quote bashslash in a shell command
@ 2014-07-06 16:01 William Xu
  0 siblings, 0 replies; 8+ messages in thread
From: William Xu @ 2014-07-06 16:01 UTC (permalink / raw)
  To: help-gnu-emacs

The shell command is:
  echo foo.bar | sed -e 's/\..*//'

which will produce "foo" on bash.

If i try to pass it to shell-command-to-string:
  (shell-command-to-string "echo foo.bar | sed -e 's/\..*//'")
	=> "\n"

Then i find i need to quote the backslash in emacs once more:
  (shell-command-to-string "echo foo.bar | sed -e 's/\\..*//'")
	=> "foo\n"

Is there a function or other way that can handle this kind of backslash
quoting automatically?


-William




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-08  7:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.4940.1404662528.1147.help-gnu-emacs@gnu.org>
2014-07-06 16:22 ` quote bashslash in a shell command Pascal J. Bourguignon
2014-07-07  6:27   ` William Xu
2014-07-07 11:34     ` Aurélien Aptel
2014-07-07 15:27     ` Pascal J. Bourguignon
2014-07-08  3:59       ` William Xu
2014-07-08  5:04         ` Pascal J. Bourguignon
     [not found]   ` <mailman.4987.1404714478.1147.help-gnu-emacs@gnu.org>
2014-07-08  7:49     ` jduthen
2014-07-06 16:01 William Xu

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.