emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Batch execution and --script


From: Nick Dokos
Subject: Re: [O] Batch execution and --script
Date: Wed, 29 Aug 2012 14:29:28 -0400

Nick Daly <address@hidden> wrote:

> On Wed, Aug 29, 2012 at 10:47 AM, Marcelo de Moraes Serpa
> <address@hidden> wrote:
> > Hey guys,
> >
> > Regarding this: http://orgmode.org/manual/Batch-execution.html
> >
> > I also had success using --script, as in:
> >
> > #!/Applications/Emacs.app/Contents/MacOS/Emacs --script
> >
> > In the top of a .el file. You can then chmod it to be executable and run it.
> 
> Would you mind sharing a simple .el file you'd use that way?  The
> site's example is a bash script, and I wonder how much cleaner a .el
> file would be.
> 

Marcelo posted a larger example, but maybe a very small example might be
helpful. Put the following in some file (I called it hello.el but the
name does not really matter):

--8<---------------cut here---------------start------------->8---
#! /usr/local/bin/emacs --script

(message "Hello World!")
--8<---------------cut here---------------end--------------->8---

Make it executable:

  chmod +x hello.el

and run it:

  ./hello.el

Nick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]