Subject: [clisp-list] obtaining script filename in script-interpreter mode

From: Eric Marsden <[email-masked]>
Date: Wed Jan 15 09:53:05 2003

Hi,

When CLISP is running in #!-interpreter mode on Unix, is there any way
of obtaining the namestring of the script?  (In perl for example this
information is available as $0; EXT:*ARGS* only provides argv[1..argc-1]).

A scenario where this information is useful is when launching a Java
program; the CLASSPATH environment variable needs to be set relative
to the location of launcher-script, rather than the directory from
which the launcher-script was executed.

-- 
Eric Marsden                          <URL:http://www.laas.fr/~emarsden/>

---

From: Sam Steingold <[email-masked]>
Date: Wed Jan 15 10:25:05 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] obtaining script filename in script-interpreter mode"
> * Sent on Wed, 15 Jan 2003 18:47:36 +0100
> * Honorable Eric Marsden <[email-masked]> writes:
>

CLISP scripts work by loading the script file using the usual CL mechanism:

$ cat >> foo.lisp
#!/usr/local/bin/clisp
(format t "I am ~s~%" *load-truename*)
C-d
$ chmod +x foo.lisp
$ ./foo.lisp
I am #P"/usr/local/src/clisp/current/foo.lisp"
$

--
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
We're too busy mopping the floor to turn off the faucet.