|
发表于 2007-4-20 14:59:01
|
显示全部楼层
- /* try to run the program */
- execl(program, basename(program), (char *)0);
- /* the exec failed -- maybe it is a shell script?
- if (errno == ENOEXEC)
- execl ("/bin/sh", "sh", "-c", program, (char
- /* oh no mr bill!! */
- perror(program);
- return -1;
复制代码
UNIX FAQ中的
我不懂编程的啊。这里有一个我所知的最简单的shell的源码,叫osh,是对Thompson shell的移植,而Thompson shell是第一个UNIX shell,我想这个应该有参考价值。osh我在Linux上成功编译过。
http://jneitzel.sdf1.org/osh/ |
|