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
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
- for fun
- to learn Rust
- have a shell that can customize a bit for my own needs
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.
I personally do not have a Windows box to work on, and cicada use a lot of Unix/Linux specific things internally. But you can fork it and play it with Windows maybe if you want to.
- job controls (
Ctrl-Z
,fg
,bg
etc) - and less...
- functions
- Windows support
- and more...