当前位置: 首页 > news >正文

网站被k申诉什么是h5开发

网站被k申诉,什么是h5开发,在线手机动画网站模板下载安装,推广普通话宣传周使用 getopts 命令 getopt 与 getopts 的不同之处在于#xff0c;前者在将命令行中选项和参数处理后只生成一个输出#xff0c;而后者能够和已有的 shell 位置变量配合默契。 getopts 每次只处理一个检测到的命令行参数。在处理完所有的参数后#xff0c;getopts 会退出并返…使用 getopts 命令 getopt 与 getopts 的不同之处在于前者在将命令行中选项和参数处理后只生成一个输出而后者能够和已有的 shell 位置变量配合默契。 getopts 每次只处理一个检测到的命令行参数。在处理完所有的参数后getopts 会退出并返回一个大于 0 的退出状态码。这使其非常适合用在解析命令行参数的循环中。 getopts 命令的格式如下 getopts optstring variable getopts 命令要用到两个环境变量。如果选项需要加带参数值那么 OPTARG 环境变量保存的就是这个值。 OPTIND 环境变量保存着参数列表中 getopts 正在处理的参数位置。这样在处理完当前选项之后就能继续处理其他命令行参数了。 例子 $ cat extractwithgetopts.sh  #!/bin/bash  # Extract command-line options and values with getopts  #  echo  while getopts :ab:c opt     #######while 语句定义了 getopts 命令指定要查找哪些命令行选项以及每次迭代时存储它们的变量名opt。 do case $opt in a) echo Found the -a option ;; b) echo Found the -b option with parameter value $OPTARG;; c) echo Found the -c option ;;*) echo Unknown option: $opt ;; esac  done  exit  $  $ ./extractwithgetopts.sh -ab BValue -c  Found the -a option  Found the -b option with parameter value BValue  Found the -c option  $ getopts 命令有几个不错的特性。可以在参数值中加入空格 $ ./extractwithgetopts.sh -b BValue1 BValue2 -a  Found the -b option with parameter value BValue1 BValue2  Found the -a option  $  另一个好用的特性是可以将选项字母和参数值写在一起两者之间不加空格 $ ./extractwithgetopts.sh -abBValue  Found the -a option  Found the -b option with parameter value BValue  $ getopts 命令能够从-b 选项中正确解析出 BValue 值。除此之外getopts 命令还可以将在命令行中找到的所有未定义的选项统一输出成问号 $ ./extractwithgetopts.sh -d  Unknown option: ?  $  $ ./extractwithgetopts.sh -ade  Found the -a option  Unknown option: ?  Unknown option: ?  $ 在处理每个选项时getopts 会将 OPTIND 环境变量值增 1。处理完选项后可以使用 shift 命令和 OPTIND 值来移动参数 $ cat extractoptsparamswithgetopts.sh  #!/bin/bash  # Extract command-line options and parameters with getopts #  echo  while getopts :ab:cd opt  do case $opt in a) echo Found the -a option ;; b) echo Found the -b option with parameter value $OPTARG;; c) echo Found the -c option ;; d) echo Found the -d option ;; *) echo Unknown option: $opt ;; esac  done  #  shift $[ $OPTIND - 1 ]  #  echo  count1  for param in $  do echo Parameter $count: $param count$[ $count 1 ]  done  exit  $ $ ./extractoptsparamswithgetopts.sh -db BValue test1 test2  Found the -d option  Found the -b option with parameter value BValue  Parameter 1: test1  Parameter 2: test2  $
http://www.zqtcl.cn/news/929877/

相关文章:

  • 重庆专业网站公司查看网站是否收录
  • 网站怎么做网上报名学多久可以做网站 知乎
  • 网站建设项目总结报告织梦模板建站
  • 关于网站建设的基础知识中石化十建公司官网
  • 江苏做网站怎么收费wordpress的wap插件
  • 企业营销网站建设公司哪家好网站建设团队名称
  • 法制网站建设问卷调查手机网站打开自动wap
  • 建设网站 如何给文件命名佛山网站推广市场
  • 网站客户问题解答网站建设网站规划书
  • 罗湖网站公司网络营销的种类有哪些
  • 怎么做微网站推广做一个自己的网站需要什么
  • 一个静态网站开发考虑什么最近一周新闻热点回顾
  • 北京网站设计知名乐云seo汝州建设局网站
  • 珠海左右创意园网站开发注册安全工程师报名条件和要求
  • 建设文明网站包括怎么用手机建设网站
  • 网站建设商城宁波seo深度优化平台有哪些
  • 免费企业查询网站网站建设有关的职位
  • 有哪些网站是可以做会计题目的广告网站建设设计
  • 房地产项目网站建设wordpress codecolorer
  • 网站服务器机房html5写的网站有什么好处
  • 三网合一网站源码下载宣传片拍摄手法及技巧
  • 重庆有网站公司公司做网站能抵扣进项税吗
  • 深圳南山网站开发卖东西的网站怎么建设
  • 网站开发教程全集网站内外链建设
  • 购物网站排名数商云科技
  • 哪种网站百度网盘登录入口官网
  • 做淘宝网站多少钱wordpress 七牛云存储
  • 做淘宝网站多少钱江苏省建设厅网站建筑电工证
  • 深圳网站建设 贴吧广州档案馆建设网站
  • 专注网站建设电商商城网站建设