Advertisement
Guest User

Bash prompt with primitive path shortening

a guest
Mar 15th, 2017
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.24 KB | None | 0 0
  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\] '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement