Cicada is a simple Unix shell written in Rust. It's ready for daily use.
``` $ ls | head -n3 Desktop Documents Downloads
$ echo foo bar | awk -F " " '{print $2, $1}' bar foo ```
$ ls file-not-exist 2>&1 | wc > e.txt
$ cat e.txt
1 7 46
$ ls -l `which sh`
-r-xr-xr-x 1 root wheel 630464 Mar 23 07:57 /bin/sh
``` $ echo foo; echo bar foo bar
$ echo foo && echo bar foo bar
$ echo foo || echo bar foo ```
``` $ echo sp{el,il,al}l spell spill spall
$ echo $SHELL /usr/local/bin/cicada
$ echo * Cargo.lock Cargo.toml LICENSE Makefile README.md src target ```
$ 1 + 2 * 3 - 4
3
$ (1 + 2) * (3 - 4) / 8.0
-0.375
First download the latest right binary for your system from Release Page.
Move it to right place and add runable permisson:
```
$ mv cicada-mac-v0.6.5 /usr/local/bin/cicada
$ mv cicada-linux64-v0.6.5 /usr/local/bin/cicada
$ chmod +x /usr/local/bin/cicada ```
Then you can try it by run cicada
in your shell.
Note: Rust environment is needed for installation.
You can try cicada
out without installing it by checking out the repository
and run cargo run
in its root directory.
$ git clone https://github.com/mitnk/cicada
$ cd cicada
$ cargo run
If you've checked out the cicada repository, you can do this:
$ make install
This will install cicada
under your /usr/local/bin
. Use sudo
if needed.
$ cargo install -f cicada
This will install cicada into ~/.cargo/bin/
.
Appending /usr/local/bin/cicada
into your /etc/shells
, then run
$ chsh -s /usr/local/bin/cicada
Read APIs here: https://docs.rs/cicada/0.7.2/cicada/
I think it's fair to say cicada is just a toy.
Bash is where most people come from and familiar with. So cicada is trying to support common cases that bash supports. Cicada will only be a "subset" of bash. If bash is a steamship, cicada is just a boat.
Ion is a modern system shell that is also written in Rust. It's more mature as a general shell. Ion is to Rust what xonsh to Python, which supports following stuff:
$ let string = "one two three"
$ echo $string[0]
o
$ echo $string[..3]
one
While cicada do not and will not support these features.
I don't think i have interests or energy to add (bash) functions support or (bash) shell scripting ability. If you're a heavy function/scripting user, cicada may not be your tool. If you found cicada useful, you can always add your things based on it.
As far as I can see, cicada will not introduce such complex things, and will not be another zsh/fish.
As the above anwsers hints, while cicada is trying to be POSIX, but it will not be a fully POSIX shell. However, If any command pattern is common and cicada is missing, we can add it.
It depends. If the script is only doing external things, like an configure/installation script, you can still run it. You can invoke scripts with $ ./my-script.sh
as long as it have "#!/bin/bash" stuff on the top. Or you can always run them as: $ bash my-script.sh
.
Cicada does not recognize these scripts itself. You cannot integrate these shell scripts/functions in RC files to initiate cicada shell.
Cicada is a Unix shell.
Ctrl-Z
, fg
, bg
etc)