Suppress output in non-interactive shells
Add is_interactive_shell() helper and gate all user-visible echo/debug output behind it so that non-interactive invocations (scripts, cron, ssh commands) stay silent. Move functions.sh source earlier in bashrc so helpers are available sooner.
This commit is contained in:
7
bashrc
7
bashrc
@@ -7,13 +7,16 @@ export LWS=$WORKSPACE
|
||||
LWS_DEBUG=${LWS_DEBUG:-0}
|
||||
LWS_FAST=${LWS_FAST:-0}
|
||||
|
||||
echo "Linux Workspace initialization"
|
||||
source "$LWS/functions.sh"
|
||||
|
||||
if [[ -z $LC_ALL ]]; then
|
||||
export LC_ALL=en_US.UTF-8
|
||||
fi
|
||||
|
||||
source "$LWS/functions.sh"
|
||||
if is_interactive_shell; then
|
||||
echo "Linux Workspace initialization"
|
||||
fi
|
||||
|
||||
source_directory_sh "$LWS/rc"
|
||||
source_directory_sh "$HOME/.bashrc.d"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user