10-3shell编程.ppt
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《10-3shell编程.ppt》由会员分享,可在线阅读,更多相关《10-3shell编程.ppt(30页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、Linux Shell编程编程处理用户输入处理用户输入命令行参数处理#!/bin/basha=1for(b=1;b$n),而变量$1则被丢弃,$0这个程序名称没变#!/bin/bashcount=1while-n$1doechoparameter#$count=$1count=$count+1#shiftaparmshiftdone#bashtest.shlinuxidcemclinuxracparameter#1=linuxidcparameter#2=emcparameter#3=linuxparameter#4=rac移动多个参数#!/bin/bashechotheoriginalpar
2、ameter:$*#shift3paramshift3echothenewshiftparameteris:$1#bashtest.shaabbccddeetheoriginalparameter:aabbccddeethenewshiftparameteris:dd一些运行选项选项描述-a实现所有对象-c生成计数-d指定目录-e展开对象-f指定读取数据的文件-h显示命令的帮助信息-i忽略大小写-l生成长格式的输出选项描述-n使用非交互式(批量)模式-o指定一个输出文件来重定向输出-q以quite模式退出-r递归处理目录和文件-s以silent模式执行-v生成verbose模式-x排除和拒绝-
3、y设置所有提问回答为yes#!/bin/bashwhile-n$1docase$1in-a)echothe-aoptionexists;-b)echothe-boptionexists;-c)echothe-coptionexists;*)echothe$1isnotanoption;esacshiftdone#bashtest.sh-a-b-c-d-ethe-aoptionexiststhe-boptionexiststhe-coptionexiststhe-disnotanoptionthe-eisnotanoption#!/bin/bashwhile-n$1docase$1in-a)ec
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 10 shell 编程
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内