From df1fb4f343b5f93d54514516c129ce7e1e114fcc Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Mon, 25 Nov 2024 17:32:44 +0100 Subject: [PATCH] env --- sh/main.sh | 11 ++++++++--- sh/shell.sh | 9 ++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sh/main.sh b/sh/main.sh index 4cbf317..9189197 100644 --- a/sh/main.sh +++ b/sh/main.sh @@ -1,13 +1,18 @@ +# constants + SH_MAIN_NAME="main.sh" SH_NAME="sh" -SH_SHELL="$(cat /proc/${$}/comm)" SH_ROOT="/etc/${SH_NAME}" -SH_USER="${HOME}/${SH_NAME}" SH_MAIN="${SH_ROOT}/${SH_MAIN_NAME}" -[ -n "${ENV}" ] || export ENV="${SH_MAIN}" +# variables + +SH_SHELL="$(cat /proc/${$}/comm)" +SH_USER="${HOME}/${SH_NAME}" + +# functions _sh_ifs_new() { SH_IFS="${IFS}" diff --git a/sh/shell.sh b/sh/shell.sh index 733d823..3a76cb6 100644 --- a/sh/shell.sh +++ b/sh/shell.sh @@ -27,6 +27,12 @@ SH_COLOR_MAGENTA="$(_sh_shell_color 35)" SH_COLOR_RED="$(_sh_shell_color 32)" sh_shell_configure() { + [ -n "${ENV}" ] || ENV="${SH_MAIN}" + export ENV + # prompt + PS1="\$(sh_shell_prompt \${?})" + PS2="├ " + # specific case "${SH_SHELL}" in "bash") # completion @@ -53,9 +59,6 @@ sh_shell_configure() { ;; *) ;; esac - # prompt - PS1="\$(sh_shell_prompt \${?})" - PS2="├ " } sh_shell_configure