Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tsukinoko-kun/ohmygosh
Cross platform Go implementation of a POSIX shell
https://github.com/tsukinoko-kun/ohmygosh
bash compiler interpreter posix posix-compliant shell
Last synced: about 2 months ago
JSON representation
Cross platform Go implementation of a POSIX shell
- Host: GitHub
- URL: https://github.com/tsukinoko-kun/ohmygosh
- Owner: tsukinoko-kun
- License: mit
- Created: 2024-03-02T22:36:42.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-20T14:41:58.000Z (9 months ago)
- Last Synced: 2024-06-21T14:19:52.802Z (7 months ago)
- Topics: bash, compiler, interpreter, posix, posix-compliant, shell
- Language: Go
- Homepage:
- Size: 101 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Oh My Gosh! :scream:
## Install
```bash
go get -u github.com/tsukinoko-kun/ohmygosh
```## Usage
```go
package mainimport (
"fmt"
"os""github.com/tsukinoko-kun/ohmygosh"
)func main() {
if err := ohmygosh.Execute(`echo "hello $(whoami)" | cat`); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
```## Features
- [x] Execute basic shell commands (built-in)
- [x] cd
- [x] exit
- [x] echo
- [x] cat
- [x] export
- [x] unset
- [x] whoami
- [x] pwd
- [x] which
- [ ] sudo
- [x] unix
- [ ] windows
- [x] yes
- [x] true
- [x] false
- [x] sleep
- [ ] seq
- [ ] parallel
- [x] type
- [x] Execute programs from PATH or with explicit path
- [ ] Execute shell scripts
- [ ] Shell functions
- [ ] Shell aliases
- [x] `command1 | command2` (pipe)
- [x] `command1 & command2` (parallel)
- [x] `command1 && command2` (if success)
- [x] `command1 || command2` (if failure)
- [x] `command1 ; command2` (sequential)
- [x] `command1 > file` (redirect stdout)
- [x] `command1 < file` (redirect stdin)
- [x] `command1 2> file` (redirect stderr)
- [x] `command1 2>&1` (redirect stderr to stdout)
- [x] `command1 1>&2` (redirect stdout to stderr)
- [x] `command1 &> file` (redirect stdout and stderr)
- [ ] `command1 |& command2` (pipe stdout and stderr)
- [ ] `command1 <<< "input"` (here string)
- [x] `command1 << EOF` (here document)