Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mitnk committed May 26, 2020
1 parent b7f004e commit d3ccc88
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 78 deletions.
78 changes: 4 additions & 74 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Cicada Manual
# Cicada Unix Shell Manual

Cicada is a simple bash-like Unix shell.

- [Introduction](https://github.com/mitnk/cicada/blob/master/docs/intro.md)
- [Install cicada](https://github.com/mitnk/cicada/blob/master/docs/install.md)
- [Environment Variables](https://github.com/mitnk/cicada/tree/master/docs/envs.md)
- [Cicada Builtins](https://github.com/mitnk/cicada/tree/master/docs/builtins.md)
Expand All @@ -10,83 +11,12 @@ Cicada is a simple bash-like Unix shell.
- [History](https://github.com/mitnk/cicada/tree/master/docs/history.md)
- [Job Control](https://github.com/mitnk/cicada/tree/master/docs/jobc.md)
- [Customize Prompt](https://github.com/mitnk/cicada/tree/master/docs/prompt.md)
- [Scripting](https://github.com/mitnk/cicada/tree/master/docs/scripting.md)
- [Scripting & Functions](https://github.com/mitnk/cicada/tree/master/docs/scripting.md)

### Try out cicada with Docker
### Try out Cicada Shell with Docker

```
$ docker pull mitnk/cicada
$ docker run --rm -it mitnk/cicada
(in-cicada) $ cinfo
```

## Brief Introduction on its Features

### Run programs and pipelines

```
$ ls | head -n3
Desktop
Documents
Downloads
$ echo foo,bar | awk -F "," '{print $2, $1}'
bar foo
```

### With redirections

```
$ ls file-not-exist 2>&1 | wc > e.txt
$ cat e.txt
1 7 46
```

### Command substitution

```
$ ls -l `which sh`
-r-xr-xr-x 1 root wheel 618512 Oct 26 2017 /bin/sh
$ echo "Time is $(date)."
Time is Sun Sep 2 12:04:13 CST 2018.
```

### Run multiple commands (with logical)

```
$ echo foo; echo bar
foo
bar
$ echo foo && echo bar
foo
bar
$ echo foo || echo bar
foo
```

### Shell expansions

```
$ 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
```

### Math arithmetic directly in the shell!

```
$ 1 + 2 * 3 - 4
3
$ (1 + 2) * (3 - 4) / 8.0
-0.375
$ 2 ^ 31
2147483648
```
2 changes: 1 addition & 1 deletion docs/completion.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cicada Completions
# Completions

## Path Completion

Expand Down
82 changes: 82 additions & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Introduction

Cicada is a simple bash-like Unix shell.

### Try out cicada with Docker

```
$ docker pull mitnk/cicada
$ docker run --rm -it mitnk/cicada
(in-cicada) $ cinfo
```

## Basic cicada Features

### Run programs and pipelines

```
$ ls | head -n3
Desktop
Documents
Downloads
$ echo foo,bar | awk -F "," '{print $2, $1}'
bar foo
```

### With redirections

```
$ ls file-not-exist 2>&1 | wc > e.txt
$ cat e.txt
1 7 46
```

### Command substitution

```
$ ls -l `which sh`
-r-xr-xr-x 1 root wheel 618512 Oct 26 2017 /bin/sh
$ echo "Time is $(date)."
Time is Sun Sep 2 12:04:13 CST 2018.
```

### Run multiple commands (with logical)

```
$ echo foo; echo bar
foo
bar
$ echo foo && echo bar
foo
bar
$ echo foo || echo bar
foo
```

### Shell expansions

```
$ 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
```

### Math arithmetic directly in the shell!

```
$ 1 + 2 * 3 - 4
3
$ (1 + 2) * (3 - 4) / 8.0
-0.375
$ 2 ^ 31
2147483648
```
2 changes: 1 addition & 1 deletion docs/prompt.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Customize Prompt in Cicada Shell
# Customize Prompt

In bash, you can customize your shell prompt by setting `PS1` environment
variable. In cicada, we can do this by setting `PROMPT` env in
Expand Down
2 changes: 1 addition & 1 deletion docs/rc-file.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cicada RC File
# RC File

When cicada shell is invoked as an interactive
[login shell](https://github.com/mitnk/cicada/blob/master/docs/install.md#set-cicada-as-your-login-shell),
Expand Down
2 changes: 1 addition & 1 deletion docs/scripting.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Scripting in Cicada
# Scripting & Functions

The goal of cicada is to be a useful daily-use shell and replace Bash.
It does not intend to compete with shells like zsh, fish, etc. Cicada keeps
Expand Down

0 comments on commit d3ccc88

Please sign in to comment.