From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Batch execution and --script Date: Wed, 29 Aug 2012 14:29:28 -0400 Message-ID: <3611.1346264968@alphaville> References: Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:56543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6n19-00074H-88 for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 14:29:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6n18-0000Hl-7n for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 14:29:31 -0400 Received: from g4t0016.houston.hp.com ([15.201.24.19]:1570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6n18-0000HM-2q for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 14:29:30 -0400 In-Reply-To: Message from Nick Daly of "Wed, 29 Aug 2012 11:42:52 CDT." List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nick Daly Cc: Org Mode , Marcelo de Moraes Serpa Nick Daly wrote: > On Wed, Aug 29, 2012 at 10:47 AM, Marcelo de Moraes Serpa > 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