https://github.com/info-mono/status2signal
๐ก Status code to signal name translate
https://github.com/info-mono/status2signal
basher bpkg cli converter info-mono posix signal status terminal
Last synced: 3 months ago
JSON representation
๐ก Status code to signal name translate
- Host: GitHub
- URL: https://github.com/info-mono/status2signal
- Owner: info-mono
- License: gpl-3.0
- Created: 2021-05-08T14:54:05.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-08T09:05:51.000Z (over 3 years ago)
- Last Synced: 2025-02-24T05:28:28.693Z (7 months ago)
- Topics: basher, bpkg, cli, converter, info-mono, posix, signal, status, terminal
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
status2signal
Status code to signal name translate
## ๐ก About
`status2signal` is a tool to translate [status code](https://bash.cyberciti.biz/wiki/index.php?title=The_exit_status_of_a_command#Exit_Status) to [signal name](https://en.wikipedia.org/wiki/Signal_(IPC)#POSIX_signals) written in [`portable sh`](https://github.com/dylanaraps/pure-sh-bible) inspired by [Fish's `fish_status_to_signal` command](https://fishshell.com/docs/current/cmds/fish_status_to_signal.html) and [Starship's Status module](https://starship.rs/config/#status).## ๐ Setup
### ๐งพ Dependencies
- [Unix commands](https://en.wikipedia.org/wiki/List_of_Unix_commands) to process### ๐ฅ Installation
#### ๐ง Manually
Option 1: using `curl`
```sh
curl https://raw.githubusercontent.com/info-mono/status2signal/main/bin/status2signal > ~/.local/bin/status2signal
chmod +x ~/.local/bin/status2signal
```Option 2: using `git`
```sh
git clone https://github.com/info-mono/status2signal.git ~/.local/share/status2signal
ln -s ~/.local/share/status2signal/bin/status2signal ~/.local/bin/status2signal
```#### ๐ฆ Package manager
For [Bpkg](https://github.com/bpkg/bpkg) user:
```sh
bpkg install info-mono/status2signal
```For [Basher](https://github.com/basherpm/basher) user:
```sh
basher install info-mono/status2signal
```> *If you can and want to port status2signal to other package managers, feel free to do so.*
## โจ๏ธ Usage
Run 'status2signal' in the terminal:
```sh
status2signal STATUSCODES
```Here is the list of statuses and signals that they will be translated to:
|Status|Signal |
|------|-----------|
|`0` |empty |
|`1` |`ERROR` |
|`2` |`USAGE` |
| | |
|`126` |`NOPERM` |
|`127` |`NOTFOUND` |
| | |
|`129` |`SIGHUP` |
|`130` |`SIGINT` |
|`131` |`SIGQUIT` |
|`132` |`SIGILL` |
|`133` |`SIGTRAP` |
|`134` |`SIGABRT` |
|`135` |`SIGBUS` |
|`136` |`SIGFPE` |
|`137` |`SIGKILL` |
|`138` |`SIGUSR1` |
|`139` |`SIGSEGV` |
|`140` |`SIGUSR2` |
|`141` |`SIGPIPE` |
|`142` |`SIGALRM` |
|`143` |`SIGTERM` |
|`144` |`SIGSTKFLT`|
|`145` |`SIGCHLD` |
|`146` |`SIGCONT` |
|`147` |`SIGSTOP` |
|`148` |`SIGTSTP` |
|`149` |`SIGTTIN` |
|`150` |`SIGTTOU` |
|`151` |`SIGURG` |
|`152` |`SIGXCPU` |
|`153` |`SIGXFSZ` |
|`154` |`SIGVTALRM`|
|`155` |`SIGPROF` |
|`156` |`SIGWINCH` |
|`157` |`SIGIO` |
|`158` |`SIGPWR` |
|`159` |`SIGSYS` |> *Other positive integer will be translated to `ERROR`*.
## ๐ Credits
Special thanks to:
- [**Fish**](https://fishshell.com/docs/current/cmds/fish_status_to_signal.html) by [it's contributors](https://github.com/fish-shell/fish-shell/graphs/contributors)
- [**Starship**](https://starship.rs) by [it's contributors](https://github.com/starship/starship/graphs/contributors)
---
>
Made with โค๏ธ by
@info-mono
>
>