pastebin - collaborative debugging tool
script.kpaste.net RSS


Untitled
Posted by Anonymous on Tue 3rd Mar 2015 20:08
raw | new post

  1. function exitstatus {
  2.  
  3.     EXITSTATUS="$?"
  4.     BOLD="\[\033[1m\]"
  5.     RED="\[\033[1;31m\]"
  6.     GREEN="\[\e[32;1m\]"
  7.     BLUE="\[\e[34;1m\]"
  8.     OFF="\[\033[m\]"
  9.  
  10.     PROMPT="[\u@\h ${BLUE}\W${OFF}"
  11.  
  12.     if [ "${EXITSTATUS}" -eq 0 ]
  13.     then
  14.        PS1="${PROMPT} ${BOLD}${GREEN}:)${OFF} ]\$ "
  15.     else
  16.        PS1="${PROMPT} ${BOLD}${RED}:(${OFF} ]\$ "
  17.     fi
  18.  
  19.     PS2="${BOLD}>${OFF} "
  20. }
  21.  
  22. PROMPT_COMMAND=exitstatus

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at