Unix CLI and REPL for invoking shell scripts or commands with multiple POSIX-like shells for portability testing.
npm install shall 
Contents
- shall — introduction
- Examples
- Installation
- Installation from the npm registry
- Manual installation
- Usage
- License
- Acknowledgements
- npm dependencies
- Changelog
shall is a Unix CLI and REPL for invoking shell scripts or commands with
multiple POSIX-like shells for portability testing.
shall (for shell with all (POSIX-like) shells) offers a
convenient way of running a given shell script or shell command with a default
set or specifiable set of POSIX-like shells, so as to facilitate testing of
portable (POSIX-compliant, cross-shell) shell code.
By default, the following shells are targeted, if installed: sh, dash, bash, zsh, ksh
Additionally, you can use shall:
* as a REPL, with -i.
* in a script's shebang line.
Each shell's execution is automatically timed to allow performance comparisons.
The syntax is modeled on that of the underlying shells.
See the examples below, concise usage information further below,
or read the manual.
``sh
!Hello example - sample output
`shPass a script to all shells via stdin, plus an argument on the command line.
echo 'echo "Passed to $0: $1"' | shall -s oneExecute script 'foo-script' with argument 'bar' in all shells.
shall foo-script barPrint the type of the 'which' command in Bash and Zsh.
shall -w bash,zsh -c 'type which'Enter a REPL that evaluates commands in both Bash and Dash.
SHELLS=bash,dash shall -i`Installation
Supported platforms
* When installing from the npm registry: all Unix-like platforms supported by Node.js with Bash installed.
* When installing manually: any Unix-like platform with Bash installed.
Installation from the npm registry
Note: Even if you don't use Node.js, its package manager,
npm, works across platforms and is easy to install; try curl -L http://git.io/n-install | bashWith Node.js or io.js installed, install the package as follows:
[sudo] npm install shall -g
Note:
* Whether you need
sudo depends on how you installed Node.js / io.js and whether you've changed permissions later; if you get an EACCES error, try again with sudo.
* The -g ensures _global_ installation and is needed to put shall in your system's $PATH.Manual installation
* Download the CLI as
shall.
* Make it executable with chmod +x shall.
* Move it or symlink it to a folder in your $PATH, such as /usr/local/bin (OSX) or /usr/bin (Linux).Usage
Find concise usage information below; for complete documentation, read the manual online, or, once installed, run
man shall (shall --man if installed manually).`nohighlight
$ shall --help
Cross-POSIX-compatible-shell testing:
Run a script file:
shall [-w ,...] [-q|-Q] [-p ]