Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
NAME
sh — shell command interpreterDESCRIPTION
sh is the command line interpreter for the shell language. It reads and executes commands from the standard input or the script file if specified. sh is interactive if the standard input is a terminal and no script file was specified.- -c
- The script argument contains the script's text instead of a path to the script file.
- -e
- Exit if any command exit non-zero.
- -i
- Interactively read and execute commands.
- -l
- The shell is a login shell. Interactive shells run the profile(5) script on startup instead of the shrc(5) script. This option is set if the shell is invoked by a name starting with a dash ‘-’.
- -s
- Read commands from the standard input (the default). This option can be combined with the -c option to execute the script text in the script argument before reading normally from the standard input
ENVIRONMENT
sh uses environment these variables:- ENV
- File to execute on non-login interactive startup instead of ~/.shrc per shrc(5). This variable is subject to path expansion.
- HISTFILE
- Save the shell history in this file. The default is ~/.sh_history.
- HISTSIZE
- Maximum number of commands in the saved shell history. The default is 500.
- HOME
- The user's home directory (‘~’).
- PATH
- The colon-separated list of directory paths to search for programs.
- PS1
- Interactive shell prompt when expecting a new command.
- PS2
- Interactive shell prompt when the current command continues onto another line.
- PWD
- Set to the current working directory.
- SHELL
- Set to sh.
- SHLVL
- Depth of recursive shell sessions. The outermost interactive shell (depth 1) will currently refuse to exit on an end-of-file condition (^D) when on the /dev/tty1 terminal to avoid accidentally powering off the machine.
- SORTIX_SH_BACKEND
- Name of a better shell to use for non-interactive use per proper-sh(5). This variable takes precedence over /etc/proper-sh.
FILES
- ~/.profile, /etc/profile, /etc/default/profile
- profile(5) script whose commands are run on non-login interactive shell startup.
- /etc/proper-sh
- Name of a better shell to use for non-interactive use per proper-sh(5). The SORTIX_SH_BACKEND environment variable takes precedence over this file if set. dash(1) is used by default if it is installed.
- ~/.sh_history
- The saved shell history. This location is controlled by the HISTFILE environment variable.
- ~/.shrc, /etc/shrc, /etc/default/shrc
- shrc(5) script whose commands are run on login interactive shell startup. The ENV environment variable overrides the search for the script if set.