๐Ÿ“ฆ ronitrajfr / rsh

simple shell made in C

โ˜… 4 stars โ‘‚ 0 forks ๐Ÿ‘ 4 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/ronitrajfr/rsh.git
HTTPS git clone https://github.com/ronitrajfr/rsh.git
SSH git clone git@github.com:ronitrajfr/rsh.git
CLI gh repo clone ronitrajfr/rsh
ronitrajfr ronitrajfr added ~ support 669dd8c 5 months ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .vscode
๐Ÿ“ src
๐Ÿ“„ .gitignore
๐Ÿ“„ LICENSE
๐Ÿ“„ README.md
๐Ÿ“„ README.md

rsh - A Simple C Shell

A minimal shell implementation in C, supporting basic built-in commands and external program execution.

Features

  • Prompt: Displays a $ prompt for user input.
  • Built-in commands:
  • exit [code]: Exit the shell with an optional exit code.
  • echo [args...]: Print arguments to the terminal.
  • type [command]: Identify if a command is a shell builtin or an external executable.
  • External commands: Runs programs found in your system's PATH.

Usage

  • Clone the repository:
git clone https://github.com/ronitrajfr/rsh.git
   cd rsh

  • Build:
gcc -o rsh src/main.c

  • Run:
./rsh

  • Example session:
$ echo Hello World
   Hello World
   $ type echo
   echo is a shell builtin
   $ type ls
   ls is /bin/ls
   $ exit 0

Notes

  • Only basic argument parsing is supported (no quotes, pipes, or redirection).
  • Maximum 20 arguments per command.
  • The shell is for educational purposes and does not implement advanced shell features.

License

See LICENSE.