|
From: | William Xu |
Subject: | quote bashslash in a shell command |
Date: | Mon, 07 Jul 2014 00:01:27 +0800 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |