env
This commit is contained in:
parent
25e7cc4f6c
commit
df1fb4f343
2 changed files with 14 additions and 6 deletions
11
sh/main.sh
11
sh/main.sh
|
@ -1,13 +1,18 @@
|
||||||
|
# constants
|
||||||
|
|
||||||
SH_MAIN_NAME="main.sh"
|
SH_MAIN_NAME="main.sh"
|
||||||
SH_NAME="sh"
|
SH_NAME="sh"
|
||||||
SH_SHELL="$(cat /proc/${$}/comm)"
|
|
||||||
|
|
||||||
SH_ROOT="/etc/${SH_NAME}"
|
SH_ROOT="/etc/${SH_NAME}"
|
||||||
SH_USER="${HOME}/${SH_NAME}"
|
|
||||||
|
|
||||||
SH_MAIN="${SH_ROOT}/${SH_MAIN_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_new() {
|
||||||
SH_IFS="${IFS}"
|
SH_IFS="${IFS}"
|
||||||
|
|
|
@ -27,6 +27,12 @@ SH_COLOR_MAGENTA="$(_sh_shell_color 35)"
|
||||||
SH_COLOR_RED="$(_sh_shell_color 32)"
|
SH_COLOR_RED="$(_sh_shell_color 32)"
|
||||||
|
|
||||||
sh_shell_configure() {
|
sh_shell_configure() {
|
||||||
|
[ -n "${ENV}" ] || ENV="${SH_MAIN}"
|
||||||
|
export ENV
|
||||||
|
# prompt
|
||||||
|
PS1="\$(sh_shell_prompt \${?})"
|
||||||
|
PS2="├ "
|
||||||
|
# specific
|
||||||
case "${SH_SHELL}" in
|
case "${SH_SHELL}" in
|
||||||
"bash")
|
"bash")
|
||||||
# completion
|
# completion
|
||||||
|
@ -53,9 +59,6 @@ sh_shell_configure() {
|
||||||
;;
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
# prompt
|
|
||||||
PS1="\$(sh_shell_prompt \${?})"
|
|
||||||
PS2="├ "
|
|
||||||
}
|
}
|
||||||
sh_shell_configure
|
sh_shell_configure
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue