From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Cecil Westerhof Newsgroups: gmane.emacs.help Subject: Re: Using Emacs Lisp for script writing Date: Tue, 22 Dec 2009 18:04:10 +0100 Organization: Decebal Computing Message-ID: <87skb32b5h.fsf@Traian.DecebalComp> References: <87hbrrrl3c.fsf@Traian.DecebalComp> <87vdg09ls9.fsf@Traian.DecebalComp> <87y6kv7tzb.fsf@Traian.DecebalComp> <87zl5b41fu.fsf@lion.rapttech.com.au> <871vinrp52.fsf@hubble.informatimago.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1261503736 16903 80.91.229.12 (22 Dec 2009 17:42:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Dec 2009 17:42:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 22 18:42:09 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NN8js-0001kt-7u for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 18:41:40 +0100 Original-Received: from localhost ([127.0.0.1]:49256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NN8js-00078B-2Z for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Dec 2009 12:41:40 -0500 Original-Path: news.stanford.edu!usenet.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.85.MISMATCH!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help X-Homepage: http://www.decebal.nl/ User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:eWpswLnuREoju3ddIlqkQE1JRgg= Original-Lines: 40 Original-NNTP-Posting-Host: 84.53.123.169 Original-X-Trace: 1261501451 news.xs4all.nl 22940 decebal/[::ffff:84.53.123.169]:22890 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: news.stanford.edu gnu.emacs.help:175731 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70807 Archived-At: pjb@informatimago.com (Pascal J. Bourguignon) writes: >>> It is not a big deal, but when the script is put on another system and >>> on this system clisp is in another location, the script has to be >>> modified (or a link has to be created). But halving the execution time >>> is important enough. >> >> There is a trick used by other scripting languages to get around the >> issue of the script interpreter being in a different location and for >> those systems which only handle 30 characters in the #! line >> >> #!/bin/sh >> # the next line restarts using the interpreter foobar \ >> exec foobar "$0" "$@" >> >> I wonder if something like this could work. > > Sure. > > [pjb@hubble :0.0 ~]$ cat ./s > #!/bin/sh > #| Both a lisp and sh comment. > exec clisp "$0" "$@" > |# Works like a charm. I made it: #!/usr/bin/env bash #| Both a lisp and sh comment. exec clisp -C "$0" "$@" |# And now all three work: script.cl clisp -C script.cl clisp -c script.cl -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof