Release new version 0.19.7
[grml-etc-core.git] / usr_share_grml / zsh / functions / minimal-shell
1 # spawn a minimally set up mksh - useful if you want to umount /usr/.
2 emulate -L zsh
3
4 local shell="/bin/mksh"
5 local env_file="/etc/minimal-shellrc"
6
7 if [[ ! -x ${shell} ]]; then
8     printf '`%s'\'' not available, giving up.\n' ${shell} >&2
9     return 1
10 elif [[ ! -f ${env_file} ]]; then
11     printf 'minimal-shell: Configuration missing: `%s'\''\n' ${shell} >&2
12     return 2
13 fi
14
15 exec env -i ENV="$env_file" HOME="$HOME" TERM="$TERM" ${shell}