Herbert Sitz <hes...@gmail.com> wrote: > Herbert Sitz <hesitz <at> gmail.com> writes: > > > > Not sure, but I do something similar with a single --eval: > > > > --eval '(progn (find-file "filename") (org-export-as-html-and-open 3) )' > > > > Except my version has double quotes for --eval argument and backslashes before > embedded quotes: > > --eval "(progn (find-file \"filename\") (org-export-as-html-and-open 3) > )" > >
That doesn't matter here: both of the above should work fine in a bash (or similar) shell environment. I prefer the single quote style in general, since it allows me to leave everything else unchanged[fn:1]. But shell quoting is a minefield: when you have to quote *parts* of an expression and leave other parts unquoted so that the shell can get to them (e.g. to evaluate shell variables and `...` or $(...) constructs), life starts to get difficult - and that's just the beginning[fn:2]. Nick Footnotes: [fn:1] ...unless there is a single quote in there. If I'm quoting lisp code that has a single quote, I generally write (quote foo) instead of 'foo, in order to avoid the quote mess. And often I'll just add a function to my minimal .emacs, so I can just write ... --eval '(foo)' ... on the command line: when writing foo, I don't have to worry about shell quoting rules. [fn:2] Kernighan and Pike, in their "The Unix Programming Environment", have an example on p. 128 where they remark: "The remarkable sequence of quote characters is required to capture the date in a string in the middle of the awk program." Worth taking a look if you have the book available nearby.