https://github.com/fgasper/pretty-exit-status
Shell include that shows the status of the last-executed process
https://github.com/fgasper/pretty-exit-status
bashrc exit exit-handler exitcode profile signals
Last synced: 10 months ago
JSON representation
Shell include that shows the status of the last-executed process
- Host: GitHub
- URL: https://github.com/fgasper/pretty-exit-status
- Owner: FGasper
- License: mit
- Created: 2016-01-13T23:52:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-08-30T14:02:42.000Z (almost 9 years ago)
- Last Synced: 2025-02-03T13:45:12.472Z (over 1 year ago)
- Topics: bashrc, exit, exit-handler, exitcode, profile, signals
- Language: Shell
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pretty-exit-status.sh
Shell include that shows the status of the last-executed process
To use:
1) Save `pretty-exit-status.sh` somewhere sensible.
(e.g., `~/.pretty_exit_status.sh`)
2) In your `.bashrc` or `.bash_profile` add the following:
```
source ~/.pretty_exit_status.sh
```
(or wherever you saved the script)
3) Later on in that same `.bashrc` or `.bash_profile`,
put the following somewhere in the `PS1` variable:
```
$(pretty_exit_status $?)
```
For example, if you just want to prefix your current prompt,
just do:
```
export PS1='$(pretty_exit_status $?)\n'$PS1
```
That’s it! :)