Re: [PATCH 2/3] test: Add `test_emacs_expect_t'.

Subject: Re: [PATCH 2/3] test: Add `test_emacs_expect_t'.

Date: Thu, 19 Jan 2012 13:01:23 +0200

To: David Edmondson

Cc: notmuch

From: Tomi Ollila


On Thu, 19 Jan 2012 10:42:31 +0000, David Edmondson <dme@dme.org> wrote:
> On Thu, 19 Jan 2012 12:32:21 +0200, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> > Consider the following:
> > 
> > $ emacsclient --eval '(print "$(echo rm -rf /); echo `date +%Y`")'
> > "$(echo rm -rf /); echo `date +%Y`"
> 
> Or:
> 
> $ emacsclient --eval '(shell-command "rm -rf /")'
> 
> What's your point?

The point it that you need to quote all shell metacharacters 
(at least '$', '`', ';' and '&') always in your test output for eval:ing...
Writing to file from elisp test function for comparison is simpler.

Tomi

Thread: