OS2021_Project1.Shell
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.4 KiB

пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
пре 3 година
  1. # OS2021_Project1.Shell
  2. ###
  3. #### yeeshell.c
  4. main function and function definition
  5. #### yeeshell.h
  6. function declaration and macro definition
  7. ###
  8. ### 1. Deployment
  9. Pull from my shuishan git.
  10. ```shell
  11. git clone root@gitea.shuishan.net.cn:10195501441/OS2021_Project1.Shell.git
  12. ```
  13. In the **MINIX3** environment, use clang to compile the program.
  14. ```shell
  15. clang yeeshell.c -o yeeshell
  16. ```
  17. Run yeeshell.
  18. ```shell
  19. ./yeeshell
  20. ```
  21. ### 2. Test Case
  22. ​ (1) `cd /your/path`
  23. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/cd.png" alt="cd" style="zoom: 76%;" />
  24. ​ (2) `ls -a -l`
  25. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/ls.png" alt="ls" style="zoom:76%;" />
  26. ​ (3) `ls -a -l > result.txt`
  27. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/redirect_out.png" alt="redirect_out" style="zoom:76%;" />
  28. ​ (4) `vi result.txt`
  29. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/vi.png" alt="vi" style="zoom:76%;" />
  30. ​ (5) `grep a < result.txt`
  31. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/redirect_in.png" alt="redirect_in" style="zoom:76%;" />
  32. ​ (6) `ls -a -l | grep a `
  33. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/pipe.png" alt="pipe" style="zoom:76%;" />
  34. ​ (7) `vi result.txt &`
  35. ​ This command can not be executed in the **MINIX3** environment. It prints the following error information.
  36. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/vi_bg.png" alt="vi_bg" style="zoom:76%;" />
  37. ​ (8) `mytop `
  38. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/mytop.png" alt="mytop" style="zoom:76%;" />
  39. ​ (9) `history n`
  40. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/history.png" alt="history" style="zoom:76%;" />
  41. ​ (10) `exit`
  42. <img src="http://gitea.shuishan.net.cn/10195501441/OS2021_Project1.Shell/raw/branch/master/lab_report/test_case_img/exit.png" alt="exit" style="zoom:76%;" />