为了搞定字符终端交互处理的一些编程问题,决定分析一下shell的代码。
找了一个BASH的代码。
来源:http://tiswww.case.edu/php/chet/bash/bashtop.html
BASH:The GNU Bourne-Again SHell
The current version of bash is bash-4.2. (GPG signature).
从上述链接下载到一个bash-4.2.tar.gz,解压缩后,建立Source Insight工程。
shell.c中的main函数,函数最后两行:
reader_loop ();
exit_shell (last_command_exit_value);
}
看起来就是我要深入分析的入口了。