- 7
- 0
- 约5.51千字
- 约 24页
- 2017-03-18 发布于贵州
- 举报
本课内容 Shell 逻辑判断 Shell 条件判断 Shell 循环处理 文件状态测试 字符串测试 test 和 [ 命令 Test命令的别名 [ ,在usr/bin目录下 test 和 [ 的语法如下:test expression[ expression ]以上两种表达式等价 在有if 语句的时候一般使用 [ ] 不用test shell命令执行的相应顺序 命令1 命令2???? 如果这个命令1执行成功 那么执行这个命2 mv myfile myfile2 echo if you are seeing this then mv was success!“ || 命令1 || 命令2? 如果| |左边的命令(命令1)未执行成功,那么就执行| |右边的命令(命令2) mv myfile myfile2 2 /dev/null || echo if you are seeing this then mv was failed! 获取用户输入 使用read命令可以获取用户的输入并赋予变量 read?var1?var2..... exp6.sh #!/bin/bashecho “Please input your name:”read nameecho Your name is:$name 任务二、比较两个数 #!/bin/bash num1=100 n
您可能关注的文档
- lecture 11 leical cohesionlecture 11 lexical cohesionlecture 11 lexical cohesionlecture 11 lexical cohesion.ppt
- lecture 8双关、轭搭配lecture 8双关、轭式搭配lecture 8双关、轭式搭配lecture 8双关、轭式搭配.ppt
- lecture 12lecure 12lecture 12lecture 12.doc
- lecture 8 观点论类,解释类作文、分主题写作lecture 8 观点论证类,解释类作文、分主题写作lecture 8 观点论证类,解释类作文、分主题写作lecture 8 观点论证类,解释类作文、分主题写作.ppt
- lecture 6 traslation of certificateslecture 6 translation of certificateslecture 6 translation of certificateslecture 6 translation of certificates.ppt
- lecture 16 yad salelecture 16 yard salelecture 16 yard salelecture 16 yard sale.ppt
- lecture 11 enlish idiomslecture 11 english idiomslecture 11 english idiomslecture 11 english idioms.ppt
- lecture 17 mathew arnold and dover beachlecture 17 matthew arnold and dover beachlecture 17 matthew arnold and dover beachlecture 17 matthew arnold and dover beach.ppt
- lecture 20 英文议信lecture 20 英文建议信lecture 20 英文建议信lecture 20 英文建议信.ppt
- lecture eightecture eightlecture eightlecture eight.doc
最近下载
- SH∕T 0822-2010 润滑油中磷、硫、钙和锌含量的测定 能量色散x射线荧光光谱法.pdf
- 消毒供应中心安全警示教育.pptx VIP
- 考研真题 北京林业大学材料科学与技术学院815化工原理历年考研真题汇编.docx VIP
- ISO 11010-12022 乘用车.模拟模型分类.第1部分车辆动力学标准立项发展报告.docx
- 中国肋骨骨折临床诊疗指南(2025版).docx
- 画法几何及土木工程制图习题集(第五版)朱育万课后习题答案.docx
- 补货与拣货任务冲突交接手册与班次衔接.docx VIP
- 短剧头部公司海鱼星空介绍.pptx VIP
- 分配定律萃取平衡概念辨析手册.docx VIP
- 配网工程施工项目管理手册.doc VIP
原创力文档

文档评论(0)