2 Starting Up
cd
&optional
directory-pathname
pwd
These functions allow you to move around in the file system without exiting the Lisp environment.
cd
sets the current working directory. If a pathname argument is provided, the current working directory is set to it. If no argument is provided, the current working directory is set to your home directory.
pwd
returns a pathname for the current working directory.
cd
is used to set the current working directory, the Common Lisp variable*default-pathname-defaults*
is set to the new working directory.
cd
to set the current working directory from the top level of Lisp is preferable to setting the value of the variable*default-pathname-defaults*
explicitly;cd
keeps the operating system informed about which working directory is current. The functionworking-directory
is the preferable method for changing working directories within programs.> (pwd) #P"/liquid6/win/"> (cd) #P"/u/win/"
> (cd "/liquid/bin") #P"/liquid/bin/"
> (pwd) #P"/liquid/bin/"
working-directory
(in The Advanced User's Guide)
quit
&optional
status
quit
terminates the Lisp environment. Before returning to the operating system environment,quit
exits to the top level of Lisp by using the Common Lisp special formthrow
. Therefore, ifquit
is called from inside the Common Lisp special formunwind-protect
, all of the cleanup forms specified by the invocation ofunwind-protect
are executed beforequit
returns to the operating system environment. Thus,quit
can be used to close all files.
shell
&optional
command-line
shell
starts a shell.
shell
starts an inferior shell that executes the command line and returns. If the argument is not specified,shell
starts an inferior shell; the shell to be started is determined by the value of theSHELL
environment variable.
shell
returns a fixnum status code.
> (shell "ls /usr/games") adventure boggle chess gammontool random arithmetic boggledict chesstool hack teachgammon backgammon boggletool cribbage hangman wump banner btlgammon factor lib bcd canfield fish life bj canfieldtool fortune number bogdict cfscores gammonscore primes 0> (shell) % ls /usr/games adventure boggle chess gammontool random arithmetic boggledict chesstool hack teachgammon backgammon boggletool cribbage hangman wump banner btlgammon factor lib bcd canfield fish life bj canfieldtool fortune number bogdict cfscores gammonscore primes
Generated with Harlequin WebMaker