瀏覽代碼

commit files

master
杨浩然 3 年之前
父節點
當前提交
db0d8aefd2
共有 17 個文件被更改,包括 349 次插入4 次删除
  1. +77
    -1
      README.md
  2. 二進制
      lab_report/1 Shell.doc
  3. +0
    -0
      lab_report/project-1.pdf
  4. 二進制
      lab_report/structure.xmind
  5. 二進制
      lab_report/test_case_img/cd.png
  6. 二進制
      lab_report/test_case_img/exit.png
  7. 二進制
      lab_report/test_case_img/history.png
  8. 二進制
      lab_report/test_case_img/ls.png
  9. 二進制
      lab_report/test_case_img/mytop.png
  10. 二進制
      lab_report/test_case_img/pipe.png
  11. 二進制
      lab_report/test_case_img/redirect_in.png
  12. 二進制
      lab_report/test_case_img/redirect_out.png
  13. 二進制
      lab_report/test_case_img/vi.png
  14. 二進制
      lab_report/test_case_img/vi_bg.png
  15. +269
    -0
      lab_report/yeeshell.svg
  16. +3
    -3
      yeeshell.c

+ 77
- 1
README.md 查看文件

@ -1,3 +1,79 @@
# OS2021_Project1.Shell
OS2021_Project1.Shell
###
#### yeeshell.c
main function and function definition
#### yeeshell.h
function declaration and macro definition
###
### 1. Deployment
Pull from my shuishan git.
```shell
git clone root@gitea.shuishan.net.cn:10195501441/OS2021_Project1.Shell.git
```
In the **MINIX3** environment, use clang to compile the program.
```shell
clang yeeshell.c -o yeeshell
```
Run yeeshell.
```shell
./yeeshell
```
### 2. Test Case
​ (1) `cd /your/path`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\cd.png" alt="cd" style="zoom: 76%;" />
​ (2) `ls -a -l`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\ls.png" alt="ls" style="zoom:76%;" />
​ (3) `ls -a -l > result.txt`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\redirect_out.png" alt="redirect_out" style="zoom:76%;" />
​ (4) `vi result.txt`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\vi.png" alt="vi" style="zoom:76%;" />
​ (5) `grep a < result.txt`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\redirect_in.png" alt="redirect_in" style="zoom:76%;" />
​ (6) `ls -a -l | grep a `
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\pipe.png" alt="pipe" style="zoom:76%;" />
​ (7) `vi result.txt`
​ This command can not be executed in the **MINIX3** environment. It prints the following error information.
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\vi_bg.png" alt="vi_bg" style="zoom:76%;" />
​ (8) `mytop `
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\mytop.png" alt="mytop" style="zoom:76%;" />
​ (9) `history n`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\history.png" alt="history" style="zoom:76%;" />
​ (10) `exit`
<img src="E:\undergraduate\sophomore\SEM2\OS\experiments\1 Shell\OS2021_Project1.Shell\lab_report\test_case_img\exit.png" alt="exit" style="zoom:76%;" />

二進制
lab_report/1 Shell.doc 查看文件


project-1.pdf → lab_report/project-1.pdf 查看文件


二進制
lab_report/structure.xmind 查看文件


二進制
lab_report/test_case_img/cd.png 查看文件

Before After
Width: 1230  |  Height: 68  |  Size: 7.5 KiB

二進制
lab_report/test_case_img/exit.png 查看文件

Before After
Width: 1230  |  Height: 67  |  Size: 3.9 KiB

二進制
lab_report/test_case_img/history.png 查看文件

Before After
Width: 1230  |  Height: 338  |  Size: 12 KiB

二進制
lab_report/test_case_img/ls.png 查看文件

Before After
Width: 1230  |  Height: 273  |  Size: 29 KiB

二進制
lab_report/test_case_img/mytop.png 查看文件

Before After
Width: 1230  |  Height: 101  |  Size: 13 KiB

二進制
lab_report/test_case_img/pipe.png 查看文件

Before After
Width: 1230  |  Height: 305  |  Size: 34 KiB

二進制
lab_report/test_case_img/redirect_in.png 查看文件

Before After
Width: 1230  |  Height: 305  |  Size: 34 KiB

二進制
lab_report/test_case_img/redirect_out.png 查看文件

Before After
Width: 1230  |  Height: 340  |  Size: 37 KiB

二進制
lab_report/test_case_img/vi.png 查看文件

Before After
Width: 1230  |  Height: 779  |  Size: 39 KiB

二進制
lab_report/test_case_img/vi_bg.png 查看文件

Before After
Width: 1230  |  Height: 65  |  Size: 6.3 KiB

+ 269
- 0
lab_report/yeeshell.svg
文件差異過大導致無法顯示
查看文件


+ 3
- 3
yeeshell.c 查看文件

@ -251,10 +251,10 @@ int do_pipe(char **pipe_arg_1, char **pipe_arg_2)
}
}
if ((prog_2 = fork()) == 0) /* Child process 1 */
if ((prog_2 = fork()) == 0) /* Child process 2 */
{
dup2(fds[0], 0);
close(0);
dup2(fds[0]);
close(fds[0]);
close(fds[1]);

Loading…
取消
儲存