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
make
in the RishShell directory. - Execute
./RishShell
to 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.cd
orcd ~
: 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.-al
or-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:
pinfo
orpinfo [pid]
- Prints information about running and/or stopped background processes.
- Displays recently executed commands.
- Usage:
history
orhistory [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
execvp
and prints information when terminated.
- Supports ';' separated commands.
- Handles extra white spaces in commands.
customCd.c
andcustomCd.h
: Implement thecd
command.customPwd.c
andcustomPwd.h
: Implement thepwd
command.customEcho.c
andcustomEcho.h
: Implement theecho
command.customLs.c
andcustomLs.h
: Implement thels
command.customRepeat.c
andcustomRepeat.h
: Implement therepeat
command.customPinfo.c
andcustomPinfo.h
: Implement thepinfo
command.jobs.c
andjobs.h
: Implement thejobs
command.customHistory.c
andcustomHistory.h
: Implement thehistory
command.sysCommands.c
andsysCommands.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!