diff --git a/bin/nlshell b/bin/nlshell new file mode 100755 index 0000000..f5f64f6 --- /dev/null +++ b/bin/nlshell @@ -0,0 +1,38 @@ +#!/bin/bash +# -*- coding: utf-8 mode: sh -*- vim:sw=4:sts=4:et:ai:si:sta:fenc=utf-8 +source "$(dirname -- "$0")/../load.sh" || exit 1 + +force_reload= +args=( + "lancer un shell avec les fonctions de nulib préchargées" + -r,--force-reload force_reload=1 "forcer le rechargement des modules" +) +parse_args "$@"; set -- "${args[@]}" + +ac_set_tmpfile bashrc +echo >"$bashrc" "\ +if ! grep -q '/etc/bash.bashrc' /etc/profile; then + [ -f /etc/bash.bashrc ] && source /etc/bash.bashrc +fi +if ! grep -q '~/.bashrc' ~/.bash_profile; then + [ -f ~/.bashrc ] && source ~/.bashrc +fi +[ -f /etc/profile ] && source /etc/profile +[ -f ~/.bash_profile ] && source ~/.bash_profile + +# Modifier le PATH. Ajouter aussi le chemin vers les uapps python +PATH=$(qval "$NULIBDIR/bin:$PATH") + +if [ -n '$DEFAULT_PS1' ]; then + DEFAULT_PS1=$(qval "[nlshell] $DEFAULT_PS1") +else + if [ -z '$PS1' ]; then + PS1='\\u@\\h \\w \\$ ' + fi + PS1=\"[nlshell] \$PS1\" +fi + +$(qvals source "$NULIBDIR/load.sh") +NULIB_FORCE_RELOAD=$(qval "$force_reload")" + +"$SHELL" --rcfile "$bashrc" -i -- "$@"