Getting started
Native parsh requires Linux and a current stable Rust toolchain. Build from the repository:
git clone https://github.com/jmjoy/parsh.gitcd parshcargo build --release./target/release/parshTo install it on your PATH, run cargo install --path crates/parsh.
Ways to run
Section titled “Ways to run”parshparsh -c '(echo hello)'parsh examples/hello.parsh worldWith no arguments, parsh opens an interactive editor when stdin is a terminal,
otherwise it reads a script from stdin. parsh - explicitly reads stdin.
--help and --version are also available. Script arguments are the list
$args; it excludes the script filename. Scripts can start with
#!/usr/bin/env parsh once the binary is on PATH.
Options are parsed by clap. After the script path or -c SOURCE, every remaining
argument is passed through unchanged, including --help and --.
Use parsh -- -script.parsh for a script filename beginning with -.
Your first session
Section titled “Your first session”Type str "hello, " "parsh" at the $ () prompt and press Enter. parsh supplies the outer closing parenthesis and displays "hello, parsh". Enter inserts a newline when input is unfinished; Ctrl+J always inserts a newline.
(let name world)(str "hello, " $name)(echo hello $name)The first expression binds a value. The second returns text, which an interactive session displays. The third runs the native echo program and writes stdout. Script mode does not print expression return values automatically.
The browser playground supports language expressions and coreutils commands. See its capabilities for the command list and temporary files.