package
module
Version:
v0.2.0
Opens a new window with list of versions in this module.
Published: Apr 3, 2024
License: MIT
Opens a new window with license information.
Imports: 1
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Oh My Gosh! 😱
Install
go get -u github.com/Frank-Mayer/ohmygosh
Usage
package main
import (
"fmt"
"os"
"github.com/Frank-Mayer/ohmygosh"
)
func main() {
if err := ohmygosh.Execute(`echo "hello $(whoami)" | cat`); err != nil {
fmt.Println(err)
os.Exit(1)
}
}
Features
- Execute basic shell commands (built-in)
- cd
- exit
- echo
- cat
- export
- unset
- whoami
- pwd
- which
- sudo
- yes
- true
- false
- sleep
- seq
- parallel
- type
- Execute programs from PATH or with explicit path
- Execute shell scripts
- Shell functions
- Shell aliases
-
command1 | command2
(pipe)
-
command1 & command2
(parallel)
-
command1 && command2
(if success)
-
command1 || command2
(if failure)
-
command1 ; command2
(sequential)
-
command1 > file
(redirect stdout)
-
command1 < file
(redirect stdin)
-
command1 2> file
(redirect stderr)
-
command1 2>&1
(redirect stderr to stdout)
-
command1 1>&2
(redirect stdout to stderr)
-
command1 &> file
(redirect stdout and stderr)
-
command1 |& command2
(pipe stdout and stderr)
-
command1 <<< "input"
(here string)
-
command1 << EOF
(here document)
Documentation
¶
Source Files
¶
Directories
¶
cmd
|
|
|
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.