shell.pl -- Elementary shell commands
This library provides some basic (POSIX) shell commands defined in
Prolog, such as pwd
and ls
for situations where there is no shell
available or the shell output cannot be captured.
- shell
- Execute an interactive shell. The following options are tried to
find a suitable shell command:
- The Prolog flag
shell
- The environment variable
$SHELL
- The Prolog flag
posix_shell
- The environment variable
%comspec%
(Windows only)
- The Prolog flag
- 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. Uses expand_file_name/2 on the From argument.
- rm(+File) is det
- Remove (unlink) a file
Re-exported predicates
The following predicates are exported from this file while their implementation is defined in imported modules or non-module files loaded by this module.
- 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 =/=.