欢迎来到虫虫下载站 | 资源下载 资源专辑 关于我们
虫虫下载站

opts4

Advanced Bash&#8722 Scripting Guide An in&#8722 depth exploration of the art of shell scripting Me
字号:
#!/bin/sh# Program opts4# Using getopts -- Fourth try --while getopts xyz: arguments 2>/dev/nulldo    case $arguments  in	x) echo "you entered -x as an option .";;	y) echo "you entered -y as an option." ;;	z) echo "you entered -z as an option."	echo "\$OPTARG is $OPTARG.";;	\?) echo "Usage opts4 [-xy] [-z  argument]"	exit 1;;    esacdoneecho "The initial value of \$OPTIND is 1.The final value of \$OPTIND is $OPTIND.Since this reflects the number of the next command line argument,the number of arguments passed was `expr $OPTIND - 1`. "

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -