Linux教程 第4章 Linux shell程序设计.pptxVIP

  • 6
  • 0
  • 约8.85千字
  • 约 101页
  • 2021-09-13 发布于江苏
  • 举报
第4章 Linux shell程序设计;主要内容 shell的主要特点、类型,shell脚本建立和执行的方式 bash变量的分类、定义形式及引用规则 各种控制语句的格式、功能及流程 bash中算术运算的使用 bash函数的构成及调用规则 shell内置命令;4.1 shell概述 4.1.1 shell的特点和主要版本;2.shell的种类 (1)Bourne shell(简称sh) (2)C shell(简称csh) (3)Korn shell(简称ksh) (4)Bourne Again shell(即bash);4.1.2 简单shell程序示例;【例4.2】 带有控制结构的shell程序(文件名为ex2)。 $ cat ex2 #!/bin/bash # If no arguments, then listing the current directory. # Otherwise, listing each subdirectory. if test $# = 0 then ls else for i do ls -l $i | grep ^d done fi ;4.1.3 shell脚本的建立和执行; (3)将shell脚本的权限设置为可执行,然后在提示符下直接执行它。 $ chmo

文档评论(0)

1亿VIP精品文档

相关文档