
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. Note that in recent
versions (since 10.1.13) the GUI frontend swipl-win can capture
process output on all supported platforms.
shellThe shell's exit status is not our business, so shell/0 succeeds whatever it is. Note that if the shell cannot be executed shell/2 raises an exception.
shell_command(-Shell:atom)shell%comspec% (Windows only)$SHELLposix_shell
cd
cd(Dir)
pushd
pushd(+Dir)
popd
dirs
pwd
ls
ls(+Pattern)ls -F, flagging directories with /. If
the terminal supports it, Prolog source files are rendered as links
using the OSC 8 escape sequence. When using Epilog, clicking a
Prolog file opens it in the editor.
mv(+From, +To) is det
rm(+File) is det
file_style(++File, =Style) is det[multifile]
clsThe following predicates are exported, but not or incorrectly documented.
popd
pushd(Arg1)
dirs
cd(Arg1)
ls(Arg1)