一个实现了简单Shell功能的程序
1.编译程序
gcc shell.c -o myShell
2.执行
$ .myShell
- 输入支持的相关指令
- $ echo arg1 arg2 arg3
- $ ls /bin /usr/bin /home
- $ cd /bin
- $ pwd /bin
- $ echo hello >log
- $ cat log
hello
$ cat /etc/passwd | wc -l
- $ cat input.txt
3
2
1
- $ cat <input.txt | sort | uniq | cat >output.txt
- $ cat output.txt
1
2
3
- zh.wen [email protected]