RishShell is a custom shell developed by Rishabh Khanna using the C programming language. This shell provides a command-line interface with various implemented commands, allowing users to navigate directories, manage processes, and execute commands efficiently.
To run RishShell, follow these steps:
- Run
makein the RishShell directory. - Execute
./RishShellto start the shell. - Type "quit," "bye," or "exit" to exit the shell.
Upon execution, the shell prompt takes the form: <username@system_name:curr_dir>. The home directory is represented by "~".
- Changes the current working directory.
- Usage:
cd [directory path]: Change to the specified directory.cdorcd ~: Change to the home directory.cd -: Change to the previous working directory.
- Prints the absolute path to the current working directory.
- Prints the given string after removing extra white spaces.
- Lists files in alphabetical order.
- Flags:
-l: Displays extra information regarding files.-a: Displays hidden files.-alor-la: Displays extra information for all files, including hidden ones.
- Executes a given instruction multiple times.
- Usage:
repeat [num] [command]
- Prints information about a process.
- Usage:
pinfoorpinfo [pid]
- Prints information about running and/or stopped background processes.
- Displays recently executed commands.
- Usage:
historyorhistory [num]
- Exits the shell.
- Also exits on "bye" and "exit" commands or by pressing
Ctrl+D.
- Foreground: Handles foreground processes using
execvp. - Background: Handles background processes using
execvpand prints information when terminated.
- Supports ';' separated commands.
- Handles extra white spaces in commands.
customCd.candcustomCd.h: Implement thecdcommand.customPwd.candcustomPwd.h: Implement thepwdcommand.customEcho.candcustomEcho.h: Implement theechocommand.customLs.candcustomLs.h: Implement thelscommand.customRepeat.candcustomRepeat.h: Implement therepeatcommand.customPinfo.candcustomPinfo.h: Implement thepinfocommand.jobs.candjobs.h: Implement thejobscommand.customHistory.candcustomHistory.h: Implement thehistorycommand.sysCommands.candsysCommands.h: Implement foreground and background process handling.
- The shell is equipped to execute multiple ';' separated commands.
- Handles extra spaces and tabs in commands.
- Command history is stored in ".RishShell_history" for reference.
Feel free to explore and customize RishShell for your command-line needs!