Bash prompt with primitive path shortening

a guest Mar 15th, 2017 262 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PS1='\[\e[2;37m\]\! \[\e[1;32m\]\u@\H\[\e[0m\] $(if [[ ${#PWD} -gt 30 ]]; then echo "${PWD:0:14}..${PWD:(-14)}"; else echo "${PWD}"; fi) $(if [[ $? != 0 ]]; then echo "\[\e[31m\]"; fi)$([ \j -gt 0 ] && echo "\[\e[2;37m\][\j]\[\e[0m\] ")\$\[\e[0m\] '
RAW Paste Data
Want to get better at Bash?
Learn to code Bash in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!