X-Git-Url: https://git.distorted.org.uk/~mdw/profile/blobdiff_plain/34a5ea4e12b23b6fc6573768a512070891cc8c43..c08211aa9838ecdb251e5df62f9c6394676349ee:/bashrc?ds=inline diff --git a/bashrc b/bashrc index 7f4cd74..fd91584 100644 --- a/bashrc +++ b/bashrc @@ -289,6 +289,33 @@ pathhack () { fi } +# --- Switching security worlds --- + +world () { + local nfast=${NFAST_HOME-/opt/nfast} + local kmdata + case "$#" in + 0) + echo "${NFAST_KMDATA#$nfast/kmdata-}" + ;; + *) + if [ -d "$1" ]; then + kmdata=$1 + elif [ -d "$nfast/kmdata-$1" ]; then + kmdata=$nfast/kmdata-$1 + else + echo >&2 "world: can't find world $1" + return 1 + fi + shift + case "$#" in + 0) export NFAST_KMDATA=$kmdata ;; + *) "$@" ;; + esac + ;; + esac +} + # --- Fix `man' under Slowaris --- case "$MACHTYPE" in