n this question, you will develop your own version of shell. Your shell will execute commands given by the user. The steps involved will be as follows: 1. User types a command, such as “cp ./OS ../newOS”. The command will be stored in a character array or a string object. 2. Shell will perform tokenization and separate the command and its arguments. 3. Shell will create a child process and use execvp system call to execute the command. 4. Shell will wait for the command to finish execution. 5. After the command has been executed, shell will ask the user to enter the command again. 6. Shell will exit when the command given by the user is “exit”. Extend the shell that you created and add support for input/output redirection. So, the commands in which |, < and > symbols are used should be supported by your shell in assignment 2. ls > file.txt man fork | grep child > file.txt The command can have any number of | symbols, such as command1 | command 2 | command3 > file.txt
In this question, you will develop your own version of shell. Your shell will execute commands given by
the user. The steps involved will be as follows:
1. User types a command, such as “cp ./OS ../newOS”. The command will be stored in a character
array or a string object.
2. Shell will perform tokenization and separate the command and its arguments.
3. Shell will create a child process and use execvp system call to execute the command.
4. Shell will wait for the command to finish execution.
5. After the command has been executed, shell will ask the user to enter the command again.
6. Shell will exit when the command given by the user is “exit”.
Extend the shell that you created and add support for input/output redirection. So, the
commands in which |, < and > symbols are used should be supported by your shell in assignment 2.
ls > file.txt
man fork | grep child > file.txt
The command can have any number of | symbols, such as
command1 | command 2 | command3 > file.txt
Trending now
This is a popular solution!
Step by step
Solved in 3 steps