Last active
May 29, 2020 10:51
-
-
Save mhamilt/9f103200b7205c00d27a4af62e9040ed to your computer and use it in GitHub Desktop.
Random changing emoji prompt in bash
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
# declares an array with the emojis we want to support | |
EMOJIS=("🐑" "🦔" "🐈" "🦆" "🐓") | |
# function that selects and return a random element from the EMOJIS set | |
RANDOM_EMOJI() { | |
SELECTED_EMOJI=${EMOJIS[$RANDOM % ${#EMOJIS[@]}]}; | |
echo $SELECTED_EMOJI; | |
} | |
# declare the terminal prompt format | |
export PS1='$(RANDOM_EMOJI) ' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment