《unix-os教学课件》第五章-shell程序设计.pptVIP

  • 0
  • 0
  • 约1.14万字
  • 约 56页
  • 2023-03-16 发布于中国
  • 举报

《unix-os教学课件》第五章-shell程序设计.ppt

if-then-fi 例子 例子: shell程序6_shell.sh, 命令行参数是否为已存在的文件或目录名. 6_shell.sh #! /bin/bash if [ -f $1 ] then echo File $1 exists fi if [ -d $HOME/$1 ] then echo File $1 is a directory fi if-then-fi 的运行结果 [root@stu1 no11]# ./6_shell.sh 6.1_shell.sh File 6.1_shell.sh exists [root@stu1 no11]# ./6_shell.sh no11 File no11 is a directory if-then-else-fi 语句 语法结构为: if [ 表达式 ] then 命令表1 else 命令表2 fi

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档