Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

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

shrc — login shell startup

SYNOPSIS

$ENV

~/.shrc

/etc/shrc

/etc/default/shrc

DESCRIPTION

Interactive non-login shell sessions in sh(1) execute the commands in the shrc script upon startup, using the ENV environment variable with path expansion if set, and otherwise searching for the user's script at ~/.shrc, any system administrator provided script at /etc/shrc, or any operating system provided script at /etc/default/shrc, whichever exists first.
The profile(5) script is run instead in interactive login shell sessions.

ENVIRONMENT

ENV
File to execute on non-login interactive startup instead of searching the standard paths for the shrc script. This variable is subject to path expansion.

FILES

~/.shrc
The user's shrc script.
/etc/shrc
The system administor provided shrc script.
/etc/default/shrc
The operating system provided shrc script.

SEE ALSO

dash(1), sh(1), shrc(5)

CAVEATS

dash(1) does not use the shrc script, but instead only uses the ENV environment variable. To invoke the shrc script portably across all standard shells upon startup of non-interactive login sells, set the ENV variable to the user's shrc script per the example in profile(5).

BUGS

sh(1) is currently primitive and cannot execute most scripts. Beware of sharing the shrc script between it and other shells such as dash(1).
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org