Skip to content

Instantly share code, notes, and snippets.

@iamdylanngo
Created March 8, 2021 10:56
Show Gist options
  • Save iamdylanngo/c2a9b5015b08ff3ac33f61013513b5fb to your computer and use it in GitHub Desktop.
Save iamdylanngo/c2a9b5015b08ff3ac33f61013513b5fb to your computer and use it in GitHub Desktop.
exit-bash-code
# For example:
## my-bash.sh
```bash
echo "Hello world"
exit 0
```
## Run command
bash my-bash.sh && echo "Good bye"
Result:
```bash
Hello world
Good bye
```
## Run command again
bash my-bash.sh || echo "Good bye"
Result:
```bash
Hello world
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment