The Task
You are required to write a simple shell in C in Linux. The features of this shell are described below. The features described below can be implemented in any order. The marks for demonstrating each feature are shown below.
Shell Features
1.Your shell should support the following built-in commands:
1.info: Print the following to the standard output where USERNAME is replaced with your own – “Simplified Shell by USERNAME”.
2.exit: Close the shell and terminate.
3.pwd: Print the current working directory of the shell to the standard output.
4.cd PATH: change the current working directory of the shell to the directory given by the parameter PATH.
2.Run another program from your shell.
1.ex PATH: execute the program specified in the PATH parameter.
2.ex PATH ARGS: execute the program specified in the PATH parameter and pass it the remaining arguments.
3.Allow the commands to be pipelined between processes using the standard ‘|’ character. The command ex ProgA | ex ProgB should redirect the standard output of ProgA to the standard input of ProgB.
4.Create a new command search that takes a text input, allowing the use of the asterisk “*” regular expression as a wildcard, and lists all files in the current directory with a similar name. For example, search *.txt will list all text files in the current folder.
5.Implement any one additional feature of your own design to the shell. Possible examples could be: customisable prompts, new built-in commands or colour styling of output.
Report(README)
Write a report on your implementation of the shell with a maximum length of 5 sides of A4. You should reference any additional materials that you have used, including any tutorials or documentation. Your report should be formatted with the main text body in Arial point size 11, 1.5 line spacing, your name in the header and page number in the footer.
In your report you should discuss:
How you achieved each of the above features and your design decisions.
Your reason for implementing your additional feature.
The differences between your approach and other possible approaches for some features.
Some differences that would occur if you implemented this shell for a different operating system.
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。