I couldn't get that script to work so I started over with:
Code:
PS3="Enter foreground color choice: "
select fgcc in black red green yellow blue purple cyan white exit
do
case ${fgcc} in
"black") export fgc=30;;
"red") export fgc=31;;
"green") export fgc=32;;
"yellow") export fgc=32;;
"blue") export fgc=34;;
"purple") export fgc=35;;
"cyan") export fgc=36;;
"white") export fgc=37;;
"exit") exit;;
*) echo "Invalid Choice"
exit;;
esac
break
done
PS3="Enter background color choice: "
select bgcc in black red green yellow blue purple cyan white exit
do
case ${bgcc} in
"black") export bgc=40;;
"red") export bgc=41;;
"green") export bgc=42;;
"yellow") export bgc=33;;
"blue") export bgc=44;;
"purple") export bgc=45;;
"cyan") export bgc=46;;
"white") export bgc=47;;
"exit") exit;;
*) echo "Invalid Choice"
exit;;
esac
break
done
#PS1=$'[\e[0;'"$fgc;$bgc"'\u@\h:\w\$ \]'
export PS1=$"\[\e[0;$fgc;"$bgc"m\u@\h:\w\$ \]"
Which gives the output that I can use to set the terminal colors but doesn't actually set it. ?
Another question would be how to use it so that the terminal colors changed randomly ever time a command was entered at the command line.