
shell.pl -- Elementary shell commands
This library provides some basic shell commands from Prolog, such as
pwd, ls for situations where there is no shell available or the
shell output cannot be captured.
It is developed on the ST-MINIX version. MINIX did not have a vfork()
call, and thus only allows shell/[0,1,2] if Prolog uses less than half
the amount of available memory.
shell- Execute an interactive shell. The executed shell is defined by
the environment
SHELLorcomspec(Windows). If neither is defined,/bin/shis used.
cd
cd(Dir)- Change working directory
pushd
pushd(+Dir)
popd
dirs- Manage the directory stack:
pwd- Print current working directory
ls
ls(+Pattern)- Listing similar to Unix =ls -F=, flagging directories with =/=.
mv(+From, +To) is det- Move (Rename) a file. If To is a directory, From is moved into the directory.
rm(+File) is det- Remove (unlink) a file
name_to_file(+Name, -File)[private]- Convert Name into a single file.
warning(+Fmt, +Args:list) is det[private]
table(+List, +Width)//[private]- Produce a tabular layout to list all elements of List on lines
with a maximum width of Width. Elements are placed as
lsdoes:1 4 7 2 5 8 3 6
cd
cd(Dir)- Change working directory
pushd
pushd(+Dir)
popd
dirs- Manage the directory stack:
pushd
pushd(+Dir)
popd
dirs- Manage the directory stack:
pushd
pushd(+Dir)
popd
dirs- Manage the directory stack:
ls
ls(+Pattern)- Listing similar to Unix =ls -F=, flagging directories with =/=.