penguin/utils

my env utils

commit 622b7ef4e243be05268d988768bd877834b0f841

author斟酌 鵬兄 <tgckpg@gmail.com>
date2026-06-27T09:33:39Z
subjecthostname command is not universal
commit 622b7ef4e243be05268d988768bd877834b0f841
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date:   2026-06-27T09:33:39Z

    hostname command is not universal
---
 bash/core/00_env.bash | 8 ++++----
 bash/rbashrc          | 7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/bash/core/00_env.bash b/bash/core/00_env.bash
index 817ba70..0ab2e86 100755
--- a/bash/core/00_env.bash
+++ b/bash/core/00_env.bash
@@ -4,9 +4,9 @@ RDOMAIN="${RDOMAIN:-<DOMAIN>}"
 RCOLOR="${RCOLOR:-<RCOLOR>}"
 
 if [ "$RHOSTNAME" = "<HOSTNAME>" ]; then
-  RHOSTNAME="\u"
-  RDOMAIN="@$(hostname -s)"
-  RCOLOR=$(( RANDOM * 6 / 32767 + 1 ))
+	RHOSTNAME="$(whoami)"
+	RDOMAIN="@HOST_NAME"
+	RCOLOR=$(( RANDOM * 6 / 32767 + 1 ))
 fi
 
-_RBASH_LOADED=
\ No newline at end of file
+_RBASH_LOADED=
diff --git a/bash/rbashrc b/bash/rbashrc
index 503e20a..11e486a 100755
--- a/bash/rbashrc
+++ b/bash/rbashrc
@@ -27,13 +27,14 @@ RDOMAIN="${RDOMAIN:-<DOMAIN>}"
 RCOLOR="${RCOLOR:-<RCOLOR>}"
 
 if [ "$RHOSTNAME" = "<HOSTNAME>" ]; then
-  RHOSTNAME="\u"
-  RDOMAIN="@$(hostname -s)"
-  RCOLOR=$(( RANDOM * 6 / 32767 + 1 ))
+	RHOSTNAME="$(whoami)"
+	RDOMAIN="@HOST_NAME"
+	RCOLOR=$(( RANDOM * 6 / 32767 + 1 ))
 fi
 
 _RBASH_LOADED=
 
+
 # ---- rbash: bash/core/05_config.bash ----
 
 __rbash_init_config() {