Last active
November 5, 2023 16:02
-
-
Save gabldotink/a3c66d67d48be62f8ab9e5c14dee6e29 to your computer and use it in GitHub Desktop.
POSIX PS1 and PS2. a bit slow. CC0 1.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1_FUNC(){ | |
if [ "$(id -u)" = 0 ] | |
then PS1_FUNC_SYMBOL='#' | |
else PS1_FUNC_SYMBOL='$' | |
fi | |
printf 'gab@gabuntu %s %s | |
%s> ' "$PWD" "$(date '+%Y-%m-%d %H:%M:%S %Z UTC%z')" $PS1_FUNC_SYMBOL | |
} | |
PS2_FUNC(){ | |
printf '=> ' | |
} | |
PS1='$(PS1_FUNC)' | |
PS2='$(PS2_FUNC)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment