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
#!/bin/bash | |
function addcolor | |
{ | |
local newcolor="\e[${3}m\033[$1;${2}m" | |
colors+=("$newcolor") | |
#echo -e "${newcolor}Adding new color$RESET: $1, $2, $3" | |
} | |
function askAllColors | |
{ |
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
function updatePS1() | |
{ | |
#... | |
local RESET="\[\033[00m\]" | |
local hosttext="\[$(colorize.sh $hostname)\]$(echo $hostname)$RESET" | |
export PS1="foobarbaz@$hosttext :" | |
#... | |
} | |
PROMPT_COMMAND=updatePS1 |