Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MrNavaStar committed Aug 8, 2024
1 parent 0a56c45 commit 73328d2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,27 @@ You can catch most unix signals sent to an application, excluding only special s
A signal can be listened for by passing the name of the signal (excluding the sigpart):
```bash
# listen for SIGINT or ctr+c
gdmp --int my_prog --my-prog-flags/args
```
You can block a signal from reaching the program by passing -x after the signal name.
```bash
# Block SIGINT or ctrl+c
gdmp -int -x my_prog --my-prog-flags/args
gdmp --int -x my_prog --my-prog-flags/args
```
You can write to a programs stdin when a signal is captured. This works regaurdless if the signal is blocked or not.
```bash
# Write "hello program!" to stdin on SIGINT or ctrl+c
gdmp -int -x -w "hello program!" my_prog --my-prog-flags/args
gdmp --int -x -w "hello program!" my_prog --my-prog-flags/args
```
You also run a bash command when a signal is captured.
```bash
gdmp -int -w -s "echo 'hello!'" my_prog --my-prog-flags/args
gdmp --int -w -s "echo 'hello!'" my_prog --my-prog-flags/args
```

Signal chaining can be used to apply modifiers to signals in bulk:
```bash
# Block SIGINT, SIGTERM, SIGHUP and write "wow!" to stdin on SIGUSR1 or SIGUSR2.
gdmp -int -term -hup -x -usr1 -usr2 -w "wow!" my_prog --my-prog-flags/args
gdmp --int --term --hup -x --usr1 --usr2 -w "wow!" my_prog --my-prog-flags/args
```

# Compiling and installing
Expand Down

0 comments on commit 73328d2

Please sign in to comment.