[Openmcl-devel] CCL Shell Scripts

Pascal J. Bourguignon pjb at informatimago.com
Sun Nov 24 15:52:22 UTC 2013


Steven Núñez <steven.nunez at illation.com> writes:

> Greetings All,
>
> Has anyone got a formula for creating shell scripts with CCL?
> Something that equates to SBCL's —script option? I need to write some
> pipelined applications, and while "| ccl64 <options> script.lisp”
> works, the surrounding framework is easier to use if I could just
> pass in the name of an executable script.
>
> The only thing I could find was a request for shebangs some three
> years ago marked ‘won’t fix’. Are there any other options?


$ cat bin/script-ccl
#!/bin/sh
exec ccl -Q -n -e '(set-dispatch-macro-character #\# #\! (lambda (s c n) (declare (ignore c n)) (read-line s) (read-line s) (values)))' -l "$0" -e '(ccl:quit 0)' -- "$0" "$@"
(format t "~S~%" CCL:*UNPROCESSED-COMMAND-LINE-ARGUMENTS*)
(loop for line = (read-line *standard-input* nil)
      while line
      do (write-line (string-upcase line)))
$ (echo hello ; echo word) | bin/script-ccl a b c 
("bin/script-ccl" "a" "b" "c")
HELLO
WORD


-- 
__Pascal Bourguignon__
http://www.informatimago.com/




More information about the Openmcl-devel mailing list