E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
getopts
使用
getopts
处理Shell脚本参数
使用
getopts
处理Shell脚本参数编写一个shell脚本,做一些事;改进这个脚本,更好做这件事;再改进这个脚本,帮自己做些其他的事情;再改进这个脚本帮助其他人做一些事......简单的脚本处理,一般使用变量
rheostat
·
2012-11-02 14:00
参数处理-Shell传入参数的处理
2010/03/01/1634516.html另外一个参考文章:http://www.ibm.com/developerworks/cn/linux/l-bash-parameters.html,其中关于
getOpts
7sun
·
2012-09-26 17:32
参数处理
Shell传入参数
使用
getopts
处理Shell脚本参数
如果你需要处理的情况(或者分支)更多的时候,这个方法就不凑效了,这时候,就可以考虑使用
getopts
了(man
getopts
)。 在使用get
jinlinlucky
·
2012-08-28 20:21
linux
shell
Shell的
getopts
和C语言的getopt对比
Shell的
getopts
和C语言的getopt对比 Note:shell的
getopts
来处理shell脚本命令行参数的的,c语言的getopt函数是处理C程序命令行参数的,刚刚开始的时候我没注意到两者竟然有不同的在处理数据的时候
ysdaniel
·
2012-08-25 00:00
c
shell
F#
脚本
null
语言
Shell 小技巧
;thenecho"goodzip"elseecho"badzip"fi可以简化为:gzip-ta.tar.gz&&echo"goodzip"||echo"badzip"2.命令行参数解析while
getopts
_Hector
·
2012-08-17 12:25
Shell
bash
技巧
Bash
Shell 小技巧
;thenecho"goodzip"elseecho"badzip"fi可以简化为:gzip-ta.tar.gz&&echo"goodzip"||echo"badzip"2.命令行参数解析while
getopts
_Hector
·
2012-08-17 12:25
shell
技巧
bash
shell 中内部变量和环境变量
最近运行后台进程的PID* $@与$*的区别@ $@与$*的区别OLDPWD 用cd到所建目录之前的路径,路径必须是发生过改变才有值OPTARG
getopts
命令已经处理的前一个选项参数OPTIND
ryuali2010
·
2012-08-16 16:00
编程
shell
脚本
getopts
getopts
optstringname[args]
getopts
isusedbyshellprocedurestoparsepositionalparame‐
xiaocaichonga
·
2012-07-31 11:00
linux shell
getopts
#
getopts
ALL=falseHELP=falseFILE=falseVERBOSE=falsewhile
getopts
ahfvc:OPTION #将ahfvc依次传给OPTIONc后面的:表示-
xingwang.ye
·
2012-07-19 18:00
linux
shell
Linux shell
getopts
学习
有一个优点就是标准UNIX命令在执行时都具有相同的命令行格式:command-optionsparameters如果在执行Shell程序也采用上述格式,BourneShell中提供了一条获取和处理命令行选项的语句,即
getopts
njqyu
·
2012-07-14 10:51
shell
getopts
--Linux&Unix
Linux shell
getopts
学习
UNIX命令在执行时都具有相同的命令行格式:command -options parameters如果在执行Shell程序也采用上述格式,Bourne Shell中提供了一条获取和处理命令行选项的语句,即
getopts
njqyu
·
2012-07-14 10:51
shell
getopts
shell脚本之参数选项
getopts
为baseshell的内置命令,提供shell的参数扩展,能够获取shell脚本的选项,并且获取到shell脚本选项后边所跟的参数,并且能够在脚本中调用。
liufeily
·
2012-05-23 14:38
编程
脚本
选项
shell/脚本
shell脚本之参数选项
getopts
为baseshell的内置命令,提供shell的参数扩展,能够获取shell脚本的选项,并且获取到shell脚本选项后边所跟的参数,并且能够在脚本中调用。
liufeily
·
2012-05-23 14:38
编程
脚本
选项
shll
nagios plugins for check remote port status
exit1}while
getopts
"w:c:sphH:"opt;do
chengcheng5418
·
2012-05-17 01:07
status
port
remote
nagios
shell记录-传递参数
getopts
20.2.1
getopts
脚本实例 通过例子可以更好地理解g e t o p t s。以下g e t o p t s脚本接受下列选项或参数。 • a 设置变量A L L为t r u e。
ancin
·
2012-05-09 11:00
脚本
bash
shell实现把一个目录下的文件名字改为从某个数字开始的数字
use option h to get help infomation ERROR_EOF } st=0 while
getopts
"s:p:h" OPT do case
goAheadtw
·
2012-04-18 19:00
shell
linux 命令详解 二十九
用
getopts
处理命令行选项: 这里的
getopts
命令和C语言中的getopt几乎是一致的,因为脚本的位置参量在有些时候是失效的,如ls-lrt等。
学友
·
2012-03-23 16:45
linux
职场
操作系统
休闲
*
getopts
的用法*
while
getopts
"d:n:a:s:h:j:"myopt;do case$myoptin d) conffile=$OPTARG/conf/catalina.properties instanceName
zhuying_linux
·
2012-02-15 17:00
C getopt 及 shell
getopts
C/* *File:getopt.c *Author:Vicky * *Createdon2012年2月3日,上午10:34 */ #include #include #ifdef_WIN32 externintgetopt(int,char*const*,constchar*); externchar*optarg; #definesnprintf_snprint
eclipser1987
·
2012-02-03 11:00
批量 添加/删除 用户脚本
/bin/bash PWD=users.txt PASSWD=123456 while
getopts
"d:p:h" opt do case $opt in
秦汉唐宋元
·
2012-01-16 11:35
职场
批量
休闲
用户脚本
添加/删除
Shell使用
getopts
读取参数
使用
getopts
可以处理 <command> [-i infile] outfile。不过还不知道怎么处理像<command> outfile [-i infile]。
dylan.wu
·
2012-01-12 17:00
shell
shell脚本文件参数
通过使用shift,我们可以向脚本文件传递更多的参数,通过
getopts
我们能更方便地提取参数。一、shift通过使用shift,我们将shell脚
hudashi
·
2011-12-12 11:00
c
shell
String
脚本
存储
shell中的getopt与
getopts
Shell中的getopt和
getopts
都用于命令行选项支持a.
getopts
只支持短选项,getopt支持长短选项b.
getopts
是Shell内置,getopt为单独的命令一.
getopts
命令格式
linuxjcq
·
2011-11-21 16:56
shell
职场
getopt
getopts
休闲
在多台机器上自动安装软件
/bin/shwhile
getopts
f: OPT; docase $OPT inf|+f)files="$OPTARG $files";;*)echo "usage: `basename $0`
zhuying_linux
·
2011-11-15 18:00
File
bash - 参数解析(
getopts
)
getopts
用于解析命令行参数,是“shellbuiltincommandsareinheritedfromtheBourneShell”参考:http://www.gnu.org/s/bash/manual
ericzhong83
·
2011-11-09 20:00
c
shell
File
bash
each
output
又见101个shell脚本
while
getopts
"hw:"opt;do case$optin h)
hb_fukua
·
2011-10-30 22:36
linux
shell
职场
休闲
101
nagios监控脚本编写-监控cpu使用率--->来源自网上,但最新本的nagios有问题,下面是修改后的。
学习本脚本时,请关注whichcommand与while
getopts
命令。通过使用/usr/bin/procinfo或/usr/bin/sar命令获取数据。
大龙的博客
·
2011-10-26 20:00
perl模块 Getopt::Std模块的使用
::Std模块的使用:初始设置: 在程序中加入如下代码: useGetopt::Std; usevarsqw($opt_d$opt_f$opt_p);
getopts
zhangrenfang
·
2011-09-28 13:16
perl
it
shell之
getopts
细则1:当optstring以”:“开头时,
getopts
会区分invalidoption错误和missoptionargument错误,内置变量$OPTARG就是出问题的optioninvalidoption
ace_fei
·
2011-07-13 11:00
c
shell
脚本
linux下shell管理9个以下参数选项
/bin/sh #set var ALL=false HELP=false FILE=false CONFIG=0 while
getopts
ahf:c: OPTION do
raojl
·
2011-07-12 11:00
linux
shell 脚本中getopt 和
getopts
的区别
getopstring1string2..n string1中标出的字符表示合法的标志(-后面可以跟的字符),如果标志字符后面有:,说明这个标志后面(可以有0-n个空格)的stringx是它的参数, getop按string1处理string2....n,输出结果 -标志1参数1-标志2参数2.....--参数n 40:/tmp/v>getopt"a:b""-bafile"-b-afil
zhongyunde
·
2011-07-11 19:00
第七章 脚本参数的传递
脚本参数的传递 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~shift表示每次将参数位置向左平移n位 获取脚本参数 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
getopts
wugai
·
2011-07-06 13:39
职场
shift
getopts
休闲
Linux
getopts
&shift命令浅析
在Shell命令/函数中 shift常用来获取参数值(可以突破Linux 参数值只能传入$1-$9的限制),而
getopts
可用来获取选项参数  
bestchenwu
·
2011-06-09 14:00
C++
c
linux
脚本
bash
Perl 与MySQL交互示例代码
/bin/env perl use strict; use Getopt::Std; use DBI; my %options;
getopts
('
dongfang_09859
·
2011-01-28 12:27
mysql
数据库
perl
perl
休闲
与MySQL交互示例代码
读行
/bin/bash#AUtor:gaohuina#date:2011-01-14#DESC:letLINENUME=0while
getopts
":n"SWITCH;do case$SWITCHin n)
ghn1206
·
2011-01-14 17:38
职场
休闲
OPTIND
getopts
和shift 的简单应用
getopts
的简单应用:脚本:#!
490999122
·
2011-01-13 16:07
shell
职场
shift
getopts
休闲
根据输入的选项显示行号:
/bin/bashletlinenum=0while
getopts
":n"A;docase$Ainn) letlinenum=1;;\?)
ghn1206
·
2011-01-11 17:52
职场
输入
行号
休闲
选项
利用选项读行
/bin/bashleti=0while
getopts
":n"SWITCH;do case$SWITCHin n)leti=1 ;; \?)
ghn1206
·
2011-01-11 17:33
职场
休闲
readline
选项读行
利用trap ping c 类网络
利用trappingc类网络:letLINENUME=0while
getopts
":n"SWITCH;do case$SWITCHinn)letLINENUME=1;;\?)
ghn1206
·
2011-01-11 17:24
网络
ping
trap
休闲
c类网络
利用case语句
/bin/bashread-p"pleaseinputanumber:"Aread-p"pleaseinputanumber:"Bwhile
getopts
":abcd"SWITCH;do case$SWITCHin
ghn1206
·
2011-01-11 17:51
case
职场
语句
休闲
newscrips
/bin/bashwhile
getopts
":a:d:"SWITCH;do case$SWITCHina)AUTHOR=$OPTARG;;d)DESCK=$OPTARG;;\?)
ghn1206
·
2011-01-03 18:26
职场
休闲
getopst
1225 用户,组,
getopts
命令,数组array
/etcpaddwdshadowgroupgshadow用户:管理员:UID,root0系统用户:UID,1-499图通用户:UID,>50016bit,UID,2^16,0-65535redhat:2^32authentication(认证)authorization(授权)login程序用于用户登录认证组:GID私有组共有组系统组用户:基本组,附加组#useradd-uUID;-gGID;基本
zbylovecool
·
2011-01-01 21:53
用户
组
休闲
getopts命令
数组array
getopts
shift 简单用法
1、
getopts
myoption#!
zhangpoo
·
2010-12-31 17:22
职场
简单用法
shift
getopts
休闲
信号捕捉trap
getopts
一、信号捕捉trap: #!/bin/bash #Date:2010-12-2514:17:44touch/tmp/traptestmytrap(){ rm-f/tmp/traptest&>/dev/null echo"Quidthescript..." exit1 } trap'mytrap'SIGINT readA该脚本捕捉退出信号SIGINT 当脚本在执行中用户按下ctrl
19ji89ng
·
2010-12-31 14:52
脚本
职场
休闲
小组内选人(脚本)
#Version:0.01array=(LiuXingyaGaoHuinaNiuYueWeiWeiZhangYupoSunHaoyuan LiYuchaoGuoKeqin)#建立一个人名数组while
getopts
lxycneo
·
2010-12-30 14:20
职场
休闲
选人脚本
newscript.sh
/bin/bash#while
getopts
":a:b:"SWITCH;do case$SWITCHin a) AUTHOR=$OPTARG;; b) DESC=$OPTARG;; \:) echo"Unkownoptions
zzxueshaogang
·
2010-12-26 13:09
职场
bash
script
bin
休闲
脚本练习
/bin/bashwhile
getopts
":a:d:"SWITCH;do case$SWITCHin a) AUTHOR=$OPTARG;; d) DESC=$OPTARG;; \?)
negiup
·
2010-12-22 15:29
编程
linux
shell
脚本
休闲
脚本练习
/bin/bashwhile
getopts
":a:d:"SWITCH;docase$SWITCHina)AUTHOR=$OPTARG;;d)DESC=$OPTARG;;\?)
negiup
·
2010-12-22 15:29
linux
编程
脚本
Linux学习札记
[转]linux
getopts
与shift学习笔记
有一个优点就是标准UNIX命令在执行时都具有相同的命令行格式:command-optionsparameters如果在执行Shell程序也采用上述格式,BourneShell中提供了一条获取和处理命令行选项的语句,即
getopts
android83
·
2010-12-13 15:00
linux
String
unix
shell
脚本
Parameters
shell复习摘要(二)
SHELL复习摘要(二)
getopts
命令通过
getopts
可以更加容易的控制多个命令行参数。
asram
·
2010-12-04 13:24
shell
职场
休闲
上一页
1
2
3
4
5
6
7
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他