Skip to content

Instantly share code, notes, and snippets.

#!/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
{
@stenyak
stenyak / .bashrc
Created September 22, 2014 10:24
function updatePS1()
{
#...
local RESET="\[\033[00m\]"
local hosttext="\[$(colorize.sh $hostname)\]$(echo $hostname)$RESET"
export PS1="foobarbaz@$hosttext :"
#...
}
PROMPT_COMMAND=updatePS1