View difference between Paste ID: FQLbeFCu and QzSNYs6X
SHOW: | | - or go back to the newest paste.
1-
# Set the prompt
1+
# Set the prompt (Fixed to do home directory properly)
2
# Changes color if your last command failed to run successfully, but it also shortens long paths and contains the bash history number of each command for easy retrieval.
3
4-
PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \`if [[ `pwd|wc -c|tr -d " "` > 18 ]]; then echo "\\W"; else echo "\\W"; fi\`]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"
4+
PS1="\[\033[0;33m\][\!]\`if [[ \$? = "0" ]]; then echo "\\[\\033[32m\\]"; else echo "\\[\\033[31m\\]"; fi\`[\u.\h: \w]\$\[\033[0m\] "; echo -ne "\033]0;`hostname -s`:`pwd`\007"