I coded it as a part of my Operating System Lab course's assignment. Hope you have fun trying it!
myinfo
- gives username, OS name, machine architecturecd <path>
- changes directory to given path(relative or absolute) or to home directory if no path is given.history
- shows last 10 commands.exit
- exits the shell.- Complex commands with any valid number and combination of pipes, input and output redirection.
- Note:
- (i) For input/output redirection, the input and/or output file name(s) should not precede any command argument(s).
- Ex:
grep needle < haystack.txt
-> VALID grep < haystack.txt needle
-> INVALID (haystack.txt precedes needle(argument))
- Ex:
- (ii) All commands should be separated by a space.
- (i) For input/output redirection, the input and/or output file name(s) should not precede any command argument(s).
- Note:
- Background processes can be run by appending '&' at the end of the command. Ex:
sleep 10 &
.- Note:
- (i) Status of background processes can be seen by command:
jobs
. - (ii) Process can be foregrounded by command:
fg <job_id>
- (iii) Currently, you can't background a running foreground process.
- (i) Status of background processes can be seen by command:
- Note:
- All other commands available in UNIX shell.
- It will only work on Unix-based systems.
- Execute the following commands to run it:
git clone https://github.com/shlok-007/MyShell.git
cd MyShell
gcc myShell.c -o myShell.out
./myShell.out