Creates directory including parent directories, if necessary. Then changes
current working directory to it.
-: **minimal-shell()**
-Spawns a minimally set up MirBSD Korn shell. It references no files in /usr,
-so that file system can be unmounted.
-
: **modified()**
Lists files in current directory, which have been modified within the
last N days. N is an integer to be passed as first and only argument.
print 'Finished, running "swapoff -a; swapon -a" may also be useful.'
}
-# spawn a minimally set up mksh - useful if you want to umount /usr/.
-minimal-shell() {
- emulate -L zsh
- local shell="/bin/mksh"
-
- if [[ ! -x ${shell} ]]; then
- printf '`%s'\'' not available, giving up.\n' ${shell} >&2
- return 1
- fi
-
- exec env -i ENV="/etc/minimal-shellrc" HOME="$HOME" TERM="$TERM" ${shell}
-}
-
# a wrapper for vim, that deals with title setting
# VIM_OPTIONS
# set this array to a set of options to vim you always want
--- /dev/null
+# spawn a minimally set up mksh - useful if you want to umount /usr/.
+emulate -L zsh
+
+local shell="/bin/mksh"
+local env_file="/etc/minimal-shellrc"
+
+if [[ ! -x ${shell} ]]; then
+ printf '`%s'\'' not available, giving up.\n' ${shell} >&2
+ return 1
+elif [[ ! -f ${env_file} ]]; then
+ printf 'minimal-shell: Configuration missing: `%s'\''\n' ${shell} >&2
+ return 2
+fi
+
+exec env -i ENV="$env_file" HOME="$HOME" TERM="$TERM" ${shell}