PublicShow sourceshell.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.

Sourceshell
Execute an interactive shell. The executed shell is defined by the environment SHELL or comspec (Windows). If neither is defined, /bin/sh is used.
Sourcecd
Sourcecd(Dir)
Change working directory
Sourcepushd
Sourcepushd(+Dir)
Sourcepopd
Sourcedirs
Manage the directory stack:
  • pushd/1 is as cd/1, pushing th old directory on a stack
  • pushd/0 swaps the current directory with the top of the stack
  • popd/0 pops to the top of the stack
  • dirs/0 lists the current directory and the stack.
Sourcepwd
Print current working directory
Sourcels
Sourcels(+Pattern)
Listing similar to Unix =ls -F=, flagging directories with =/=.
Sourcemv(+From, +To) is det
Move (Rename) a file. If To is a directory, From is moved into the directory.
Sourcerm(+File) is det
Remove (unlink) a file
Sourcecd
Sourcecd(Dir)
Change working directory
Sourcepushd
Sourcepushd(+Dir)
Sourcepopd
Sourcedirs
Manage the directory stack:
  • pushd/1 is as cd/1, pushing th old directory on a stack
  • pushd/0 swaps the current directory with the top of the stack
  • popd/0 pops to the top of the stack
  • dirs/0 lists the current directory and the stack.
Sourcepushd
Sourcepushd(+Dir)
Sourcepopd
Sourcedirs
Manage the directory stack:
  • pushd/1 is as cd/1, pushing th old directory on a stack
  • pushd/0 swaps the current directory with the top of the stack
  • popd/0 pops to the top of the stack
  • dirs/0 lists the current directory and the stack.
Sourcepushd
Sourcepushd(+Dir)
Sourcepopd
Sourcedirs
Manage the directory stack:
  • pushd/1 is as cd/1, pushing th old directory on a stack
  • pushd/0 swaps the current directory with the top of the stack
  • popd/0 pops to the top of the stack
  • dirs/0 lists the current directory and the stack.
Sourcels
Sourcels(+Pattern)
Listing similar to Unix =ls -F=, flagging directories with =/=.