aboutsummaryrefslogtreecommitdiff
path: root/sh/shrc
blob: 9e201ef190b58c5a78b761e59303c0c2a01ae893 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Make sure the shell is interactive
case $- in
    *i*) ;;
    *) return ;;
esac

# Basic PS1 for POSIX shell; if we're using something more advanced, something
# in ~/.shrc.d should overrule this. Does every POSIX shell support these? dash
# does, at least.
PS1=$(printf '%s@%s$ ' "$(whoami)" "$(hostname -s)")

# Load all the POSIX-compatible functions from ~/.shrc.d; more advanced shells
# like bash will have their own functions
for sh in "$HOME"/.shrc.d/*.sh ; do
    [ -e "$sh" ] && . "$sh"
done
unset -v sh