1 / 13

shell 解释程序 ———— 概述

shell 解释程序 ———— 概述. http://202.112.138.112 1. Linux 第一个大作业 : Yalnix Shell(ysh) 解释程序 2. 分组信息,请确认. shell 解释程序 ———— 概述. Shell 是用户和 Linux 内核之间的接口程序,用户在 shell 提示符下输入的每一个命令都由 shell 先解释,然后传给 Linux 内核 常见的 shell 解释程序: Bourne shell (sh) C shell (csh) Korn shell (ksh). shell 解释程序 ———— 概述. 功能:

fabian
Télécharger la présentation

shell 解释程序 ———— 概述

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. shell解释程序————概述 http://202.112.138.112 1. Linux第一个大作业 : Yalnix Shell(ysh)解释程序 2. 分组信息,请确认

  2. shell解释程序————概述 • Shell是用户和Linux内核之间的接口程序,用户在shell提示符下输入的每一个命令都由shell先解释,然后传给Linux内核 • 常见的shell解释程序: • Bourne shell (sh) • C shell (csh) • Korn shell (ksh)

  3. shell解释程序————概述 功能: 执行内部命令和外部程序 提供作业控制功能 管道功能和输入输出重定向功能

  4. shell解释程序————概述 目标: 开发清晰易读、设计良好的程序 规范编写文档 熟悉Linux下的开发工具:gdb,gcc,make 从man page获得帮助 使用POSIX/UNIX API管理进程、信号和进程间通信 同小组成员交流与合作

  5. shell解释程序————要求 规格说明: 程序运行方式 提示符(ysh>) 内部命令和外部程序 前后台作业

  6. shell解释程序————要求 内部命令: exit cd jobs fg %<int> bg %<int>

  7. shell解释程序————需求 键盘输入 Control-Z:SIGSTOP信号 挂起(suspend)作业 Control-C: SIGINT信号 中断作业

  8. shell解释程序————实现 分析输入字符串 简单命令 分隔符 特殊字符( |、&、<、> )

  9. shell解释程序————实现 语法规则 Backus范式 词法分析 语法分析

  10. shell解释程序————实现 系统调用: fork(); execvp(); exit(); waitpid(); dup(); pipe(); 通过man命令查询

  11. shell解释程序————帮助 Yacc介绍: 一个语法分析程序生成器,可以从语言的语法描述生成语法分析程序。分析方法采用LALR。

  12. shell解释程序————帮助 %{ C语句,如#include语句、定义语句等等 %} Yacc定义:词法记号、语法变量、优先级和结合顺序 %% 语法规则与动作 %% 其他C语句 main() { …; yyparse(); … } yylex() { … } …

  13. shell解释程序————帮助 参考书: 《UNIX编程环境》 机械工业出版社 关于yacc的几个例子 《UNIX环境高级编程》机械工业出版社 关于系统调用的介绍

More Related