A Unix shell written in Haskell.
Well, a few reasons:
- Because I can.
- Shells exercise most of the capabilities a production-ready language needs, from I/O to process management to file and directory operations to string parsing to state management. About the only thing shells don't do much of is network I/O.
- It's accessible. My first Haskell project was an OpenSSH-compatible SFTP server which is somewhat obscure.
- Single-command parser
- Support for env vars through
setenvandgetenv - Settable prompts
- Ability to
cdand run external commands $PATHis consulted for command lookups; it automatically updates when$PATHchanges or a directory on the path is changed.
- Mis-invoking builtins (like
setenv foowhen the correct invocation issetenv foo bar) causes the shell to treatsetenvas an external command.
This is a programming exercise focused on an interactive command interpreter. I haven't much interest right now in building support for Bourne-style scriptability.
- (DONE) Basic command-line interpreter.
- (DONE) Shell-ish parser
- (DONE)
ENVvar support - (DONE) Trivial prompt generator
- (DONE) Fundamental builtins
cd
- (DONE) Command Look-Up Table creation from
$PATH - (DONE and removed since it's no longer needed)
rehashbuiltin - (DONE) Smart
rehashbased on$PATHchanges andmtimes of each dir named in$PATH - (DONE) Stop crashing on command
ENOENTs. - (DONE) Shell variable substitution
- Output redirection
- Command-name tab completion
- Argument tab completion
- Programmable prompts