4 0 |
1) echo >&2 "usage: $0 LISP SCRIPT [ARGS ...]"; exit 127 ;;
6 lisp
=$1 script=$2; shift 2
8 __CL_ARGV0
=$script; export __CL_ARGV0
# this is stupid
10 lispscript
=$
(printf "%s" "$script" |
sed 's/[\"]/\\&/g')
13 (let ((*load-verbose* nil)
14 #+cmu (ext:*require-verbose* nil))
17 ignore_shebang_rune
="\
18 (set-dispatch-macro-character
20 (lambda (stream char arg)
21 (declare (ignore char arg))
22 (values (read-line stream))))"
28 (setf *standard-input* (ext:make-stream :input))
29 (load \"$lispscript\" :verbose nil :print nil)
33 (let ((script \"$lispscript\"))
37 (java:jnew \"org.armedbear.lisp.Stream\"
39 (java:jfield \"java.lang.System\" \"err\")
42 (handler-case (load script :verbose nil :print nil)
44 (format *error-output* \"~A (unhandled error): ~A~%\" script error)
45 (ext:quit :status 255))))"
51 exec sbcl
--noinform
--eval "$load_asdf_rune" --script "$script" "$@"
55 exec ecl
--norc
--eval "$load_asdf_rune" --shell
"$script" -- "$@"
59 exec clisp
-norc
-q
-x
"$clisp_startup_rune" -- "$@"
63 exec cmucl
-batch -noinit
-nositeinit
-quiet \
64 -eval "$load_asdf_rune" \
65 -eval "$ignore_shebang_rune" \
66 -load
"$script" -eval "(ext:quit)" -- "$@"
71 -e
"$load_asdf_rune" \
72 -e
"$ignore_shebang_rune" \
73 -l
"$script" -e
"(ccl:quit)" -- "$@"
77 exec abcl
--batch --noinform
--noinit
--nosystem \
78 --eval "$abcl_startup_rune" -- "$@"
82 echo >&2 "$0: unsupported Lisp \`$lisp'"