usage: shell_example.py [-h] [-v] [-s] [-f FILE] [-r] [--session SESSION]
[cmd ...]
If no positional arguments are given then an interactive subshell is started.
positional arguments:
cmd A comma- or newline-separated list of commands
optional arguments:
-h, --help show this help message and exit
-v, --verbose
-s, --safe Safe-mode. Ask for confirmation before executing commands.
-f FILE, --file FILE Read and run FILE as a command
-r, --reload Reload last session
--session SESSION Use SESSION
Default Commands
~~~~~~~~~~~~~~~~~~~~~~~~~~
Run shell commands by prefixing them with `!`.
E.g.
./shell.py !echo abc; echo def # Bash
Run multiple Python commands by separating each command with colons or newlines.
E.g.
./shell.py 'print abc; print def
print ghi'
Variables
~~~~~~~~~~~~~~~~~~~~~~~~~~
Assign constants or evaluate expressiosn:
```
a = 100
b <- print $a
echo $a $b
```
Interopability
~~~~~~~~~~~~~~~~~~~~~~~~~~
Interopability with Bash can be done with pipes:
`|>` for Python.
`|` for Bash
`>-` for Bash (write to file)
`>>` for Bash (append to file)
1. To stdin and stdout
E.g.
```
echo abc | ./shell.py print
./shell.py print abc | echo
```
2. Within the dsl
E.g.
```
./shell.py print abc # Python
./shell.py 'print abc | echo'
./shell.py 'print abc |> print'
```