From: Stas B. <sta...@gm...> - 2009-05-12 14:19:44
|
Dorai Sitaram <ds...@ya...> writes: > Is it possible to slap some sort of shell-magic line at the head of a .fasl file so that the file can be called as a Unix command? > > Somewhat along the lines of > > ":"; exec sbcl --script $0 "$@" > > which I find only works for SBCL source (.lisp) files? > > My best effort so far is to have a separate shell script, say filename, in the same directory as filename.fasl, that has the following contents > > sbcl --noinform --load $0.fasl "$@" > > I don't mind having a separate shell script, but this relies on the shell's ability to translate $0 to the appropriate full or relative pathname. Only bash seems able to do this. (Other shells do not include the dirname when determining $0, and I cannot control the shell choices of the people I hand the script to -- hence the question.) > You can also achieve this with binfmt_misc on Linux. -- With best regards, Stas. |