Thus document describes how you can make CLISP your login shell on GNU/Linux.
You can probably use these instructions on other UNIX systems too.
last modified: 2001-06-01
Notes marked NB from SDS were added by Sam Steingold.
On Linux, you need to have built your
CLISP with the
and you should make sure that you have it compiled with readline.
See the CLISP build instructions and Makefile.
/etc/shells so it looks (something) like this:
# /etc/shells: valid login shells #/bin/ash /bin/bash /bin/sh /usr/bin/clisp
You can set up your
/etc/login.defs by modifying the entry for
ENV_PATH to look (something) like this:
Once you have your CLISP shell set up, you can control the
environment variables (on Linux) via the glibc bindings (see
setenv, putenv, getenv, etc.
CLISP has a
(setf (ext:getenv "foo") "bar").
startx command is a shell script, so we cannot use it.
As a temporary fix, I have defunned thus:
(defun startx () (execute "/usr/X11R6/bin/xinit"))
Which works for me. Although I haven't investigated all the
consequences of not going via shell's startx. Also I do not use
KDE which may complicate
things for you if you do.
I use fvwm2
and have this in my
Once CLISP is set up, you will also be able to type:
from Lisp to start X.
You should be able to run a shell script using the
CLISP built-in function
For conveniently running external programs (i.e., I do not want to
have to type
(run-program "ls" :arguments '("-lh")) every
time) I have set up a read macro.
Put the following in
(set-macro-character #\] (get-macro-character #\))) (set-dispatch-macro-character #\# #\[ (lambda (stream char1 char2) (declare (ignore char1 char2)) (setf (readtable-case *readtable*) :preserve) (unwind-protect (let ((command-line (read-delimited-list #\] stream t))) (list 'ext:run-program (princ-to-string (car command-line)) :arguments `',(mapcar #'princ-to-string (rest command-line)))) (setf (readtable-case *readtable*) :upcase))))
I heavily modified this macro.
will not execute shell scripts, while
will invoke a shell for each command - these are the trade-offs.
It's also a PITA to have to type "#[" and "]" everytime you want to
run a command, so add the following in your
#for clash: prints the square brackets to run an external command "\ec": "#\C-b"
When you type ESC-c (or META-c) readline will print "#" to the console and put the cursor inside the brackets. If you are running CLISP as your shell, and do this, you will then be able to run programs (more or less) normally. You will need to escape the dot in any filenames that start with a dot, e.g.,
> #[cat \.xinitrc]
and sometimes (eek) a colon.
Do NOT modify your
Start up a clisp with
$ clisp -K full -i somefile.fas
Hit ESC c, type ls -l, hit Enter and see if it works.
You do not have command line completion for external
programs inside the read-macro. So hitting tab will just give you a
list of all CLISP's possibilties, which is not much use here. However,
ext:run-program (which is part of what's hiding behind the
read macro) does search your path for executables so you don't have to
There are CLISP built-ins like
ext:cd, and most other
shell built-ins can be implemented in CLISP pretty easily.
If you are happy, and think you can live with this setup then you must do the following:
/usr/[local]/lib/clisp. (wherever yours is installed)
/etc/passwd to reflect your new shell.
Light 13 candles in a circle round your Linux box, Sacrifice a white rooster, invoke Saint IGNUcious and ...
If you start pining for Bash, you can run:
You will have to explicitly source all your configuration files (.profile etc)