Lisp HUG Maillist Archive

Unix scripting with LispWorks

Back when I used CLISP there was an easy way to create scripts that
where callable from the Unix command line.  It was nice because the
contents of the shell script was just plain text Lisp code and could
be edited and tweaked easily.

Is there a way to do that in LispWorks?

Regards,
Chris Dean


Re: Unix scripting with LispWorks

Maybe cl-launch is what you're looking for?
http://www.cliki.net/cl-launch

Regards
Friedrich


Re: Unix scripting with LispWorks

If you're on a unix platform, I think most standard shells
will take the first line of a script as the interpreter. So,
if you were on linux, and your lispworks binary was
/usr/bin/lispworks, I think you could probably just put

#!/usr/bin/lispworks
;;; lisp code here

in a file and get the results you're looking for. You'd
probably want to make sure that whatever binary you
pick is a console environment, and maybe change the default
behavior of  the REPL, (to avoid unwanted printing
or such). Would this be the sort of thing you're talking about?



On 21/10/05, Chris Dean <ctdean@sokitomi.com> wrote:
>
> Back when I used CLISP there was an easy way to create scripts that
> where callable from the Unix command line.  It was nice because the
> contents of the shell script was just plain text Lisp code and could
> be edited and tweaked easily.
>
> Is there a way to do that in LispWorks?
>
> Regards,
> Chris Dean
>
>


--
=====================
Joshua Taylor
tayloj@rpi.edu


Re: Unix scripting with LispWorks

Stonewall Ballard <sb.list@sb.org> writes:
> This is what I use to create a lisp app that executes shell files.
> Note that it discards the first line of the shell file it reads.

That works great!  Thanks.

Is there anything special about the deliver.lisp script that you use?
I'm just using:

    (load-all-patches)
    (load "lisp-shell")

    (deliver 'shell-app-main "lisp-shell" 0)
    (quit)

Thanks again,
Chris Dean


Re: Unix scripting with LispWorks

Joshua Taylor <joshuaaaron@gmail.com> writes:
> #!/usr/bin/lispworks
> ;;; lisp code here
....
> Would this be the sort of thing you're talking about?

Yes that's the sort of thing I'm looking for.  There was a piece of
extra wiring I was missing that Stonewall Ballard sent out.

The tweak here is that the shebang program isn't just the plain LW
app, you need to build a custom program to load the lisp program in
the body of the file.

Regards,
Chris Dean


Updated at: 2020-12-10 08:50 UTC