2 Starting Up

2.3 Reference pages

cd Function

pwd Function

Syntax:cd&optional directory-pathname

Syntax:pwd

These functions allow you to move around in the file system without exiting the Lisp environment.

The functioncd 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.

The functionpwd returns a pathname for the current working directory.

The directory-pathname argument is either a simple string or a pathname.

Ifcd is used to set the current working directory, the Common Lisp variable*default-pathname-defaults* is set to the new working directory.

Note: Calling the functioncd 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/"

See Also:working-directory (in The Advanced User's Guide)

quit Function

Syntax:quit&optional status

The functionquit 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.

The optional argument status sets the exit status of the process that was running Lisp.

If supplied, the status argument must have a fixnum value; its default value is 0.

shell Function

Syntax:shell&optional command-line

The functionshell starts a shell.

The optional command-line argument is a string of characters to be interpreted by the shell as a command line. If the argument is supplied, the functionshell 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.

The functionshell 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


The User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker