Bash-like shell implemented in Scala.
In root-directory:
user: ~/scala-shell$ sbt assembly
After that, to launch shell:
user: ~/scala-shell$ cd target/scala-2.11/
user: ~/scala-shell/target/scala-2.11$ scala scalashell-assembly-1.0.jar
Currently, following commands are supported natively:
- cat
- echo
- pwd
- wc
- exit
If the command is not recognized by the shell, then it is treated as an external command and resolved by simply calling it in system shell environment.
- pipes (
cat file1 file2 | wc
) - variables (
foo = "bar"
,echo $foo
=>bar
) - weak quoting (in a double quotation marks)
- strong quoting (in a single quotation marks)
- symbol escaping (via backslash)
- Whitespaces are ignored completely (except for quotations content, of course), so
foo = bar
,foo= bar
andfoo=bar
are all equivalent and valid expressions - Pipes are not lazy
- Some commands (like
cat
orwc
) when called without arguments enter interactive-mode, repeatedly prompting user for another line of input and processing it. In bash, one can exit that mode using CTRL-D (EOF) combination. Don't use it, this will cause shell to shut down. Instead, use\quit
-keyword.