https://github.com/petr-korobeinikov/tern
The missing ternary shell operator for humans
https://github.com/petr-korobeinikov/tern
shell
Last synced: 2 months ago
JSON representation
The missing ternary shell operator for humans
- Host: GitHub
- URL: https://github.com/petr-korobeinikov/tern
- Owner: petr-korobeinikov
- License: mit
- Created: 2021-08-15T17:21:57.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-08-15T17:45:17.000Z (almost 5 years ago)
- Last Synced: 2025-02-16T21:46:38.493Z (over 1 year ago)
- Topics: shell
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tern
[](https://goreportcard.com/report/github.com/pkorobeinikov/tern)
> The missing ternary shell operator for humans
Just need some ternary support in shell automation.
```shell
# shell mode
tern thruthy_expr yes no
yes
# boolean mode (-b)
tern -b 0 yes no
no
tern -b false yes no
no
tern "" yes no
no
```
## Tests
### Unit
```shell
go test -v -cover ./...
```
### Functional
```shell
bats --tap tests
```
## Build
```shell
go build -o ~/Bin/tern cmd/tern/main.go
```