https://github.com/harshanavkis/hash-shell
Command line interpreter
https://github.com/harshanavkis/hash-shell
command-line-interface operating-system unix-like
Last synced: 3 months ago
JSON representation
Command line interpreter
- Host: GitHub
- URL: https://github.com/harshanavkis/hash-shell
- Owner: harshanavkis
- Created: 2018-10-05T13:29:25.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-14T10:24:35.000Z (over 6 years ago)
- Last Synced: 2023-03-03T21:55:08.939Z (over 2 years ago)
- Topics: command-line-interface, operating-system, unix-like
- Language: C
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hash: Command line interpreter
**Ha**rsha **Sh**ell, is a command line interpreter written in C.
## Features and Usage
Initially when the shell is started, only commands from the /bin/ directory can be run.
```bash
>hash ls -la
```'>hash' is output after execution after each command.
User defined paths can be appended to the internal path variable.
```bash
>hash $PATH -a /usr/bin/
/usr/bin/
```And yes, the trailing '/' is necessary. After execution of the above command use the commands from the new directory as before.
```bash
>hash wc hash.c
145 317 3546 hash.c
```
Three built-in commands are provided:
- cd : can be used to change the working directory
- exit : exit from hash
- path : used to overwrite the path variable with a single path
```bash
>hash path " "
>hash ls
'ls' command not found in the current path.
Try adding the path of the command through: $PATH -a [path].
```In the above test, path variable was cleared, and ls couldn't be found!!
Output from a command can be redirected to a desired file.
```bash
>hash ls > output
```output file contains the result of ls.
## Stuff to add
- [ ] Facility for batch processing
- [ ] run many commands in parallel