[Openmcl-devel] Running ccl as a shebang script

Robert Munyer 2420506348 at munyer.com
Tue Feb 28 15:25:17 PST 2017


I've been meaning to write to this list to ask for advice, about
the way I've been using the shell and ASDF to invoke a CCL program
as a Unix tty command.  This thread seems like a good place to ask.

I deliberately set it up to be self-contained in its own, normal,
visible directory; I don't like programs that spam parts of themselves
into invisible subdirectories of $HOME.

This program only runs once per day, so I don't care if it wastes a
second starting some unnecessary /bin/sh processes, or wastes a second
loading multiple FASL files instead of loading a single heap image.

Can anyone suggest any other improvements?

See transcript below with ~10 lines of shell script, ~5 lines of ASDF,
and a directory listing, preceded by 4 commands that were typed to get
the listings.

Two clarifications:  (1) The leading and trailing newlines aren't
really in the text files; they're added by $LESSOPEN for legibility.
(2) ~/bin/report-spam is just a link to ~/report-spam/src/report-spam.

$ cd ~/report-spam
$ ls -dl $(find -name lib -prune -o -true) > ../dir.txt
$ emacs ../dir.txt  # (edit out unnecessary bulk)
$ echo; less ../bin/report-spam asd/report-spam.asd ../dir.txt | cat

::::::::::::::
../bin/report-spam
::::::::::::::

#! /bin/sh

CL_SOURCE_REGISTRY=$HOME/report-spam/asd\
 ASDF_OUTPUT_TRANSLATIONS=$HOME/report-spam/src:$HOME/report-spam/obj\
 exec\
 ccl\
 --no-init\
 --eval '(require "asdf")'\
 --eval '(require "report-spam")'\
 --eval '(in-package "REPORT-SPAM")'\
 --eval '(report-spam)'\
 --eval '(quit)'

::::::::::::::
asd/report-spam.asd
::::::::::::::

(in-package "ASDF-USER")

(defsystem "report-spam"
  :depends-on ((:require "pty") "smtp4cl")
  :components ((:file "report-spam")))

::::::::::::::
../dir.txt
::::::::::::::

drwxr-xr-x asd
lrwxrwxrwx asd/mime4cl.asd -> ../src/lib/mime4cl-20150207T211851-mod/mime4cl.asd
lrwxrwxrwx asd/net4cl.asd -> ../src/lib/net4cl-20150207T212000-mod/net4cl.asd
lrwxrwxrwx asd/report-spam.asd -> ../src/report-spam.asd
lrwxrwxrwx asd/sclf.asd -> ../src/lib/sclf-20150207T213551-mod/sclf.asd
lrwxrwxrwx asd/smtp4cl.asd -> ../src/lib/smtp4cl-20150207T212034-mod/smtp4cl.asd
drwxr-xr-x obj
drwxr-xr-x obj/lib
-rw-r--r-- obj/report-spam.lx64fsl
drwxr-xr-x src
drwxr-xr-x src/lib
-rwxr-xr-x src/report-spam
-rw-r--r-- src/report-spam.asd
-rw-r--r-- src/report-spam.lisp



More information about the Openmcl-devel mailing list