适用于循环次数未知的情况,要有退出条件。whileCONDITION;do statement ...done例如: 1.写一个脚本,输入任何字符,小写转换为大写。输入quit退出。 #!/bin/bash read-p"InputSomething"STRING while[$STRING!=‘quit‘];do echo$STRING|tr‘a-z‘‘A-Z‘ read-p"InputSomet..
分类:
其他好文 时间:
2015-01-21 06:42:20
阅读次数:
139
#!/bin/bash#数组的使用#数组赋值方式:#1. user[index]=value index为0,1,2,3,4....数组下标值#2. user=(value0 value1 value2....) 既user[n]=valuen#3. user=([2]=value2 [1]=val...
分类:
编程语言 时间:
2015-01-20 22:04:19
阅读次数:
182
#!/bin/bash//定义脚本类型foripin`seq1+1254`//将ip尾数定义在1到254之间do//开始执行ping172.16.1.$ip-c1//pingip次数一次if[$?-ne0];then//如果结果不等于0echo172.16.1.$ipisoffline//显示本机是离线的else//否则echo172.16.1.$ipisonline//显示主机是在线的fi//结束循环do..
分类:
其他好文 时间:
2015-01-20 18:34:45
阅读次数:
181
1、创建weblogic启动文件[root@weblogic01~]#cd/etc/rc.d/init.d/[root@weblogic01init.d]#vimweblogic将一下脚本复制到weblogic文件中#!/bin/bash
#chkconfig:3452080
#description:WeblogicServerautostart/stopscript.
#/etc/rc.d/init.d/weblogic
#Pleaseeditthevariable
e..
分类:
Web程序 时间:
2015-01-20 18:31:41
阅读次数:
186
#添加一个用户useradd xiaoming#设置密码passwd xiaoming 回程//设置密码就行了#把用户修改成root权限vi /etc/passwd #找到xiaoming:x:508:508::/home/xiaoming:/bin/bash 改后面的 508 为和roo...
分类:
系统相关 时间:
2015-01-20 17:44:14
阅读次数:
179
Python,Perl,Bash命令行参数 Part I日常经常性的和Perl,Python,Bash打交道,但是又经常性的搞混他们之间,在命令行上的特殊性和index的区别,Python真的是人性化到家了,但是命令行上就很原始,但是很有分类感。还是会喜欢Perl一点(至少还可以动脑子,不至于生锈)...
分类:
编程语言 时间:
2015-01-20 17:29:41
阅读次数:
199
agetty打开 tty端口,为登录名称建立命令控制符,并引出login程序如何使你的Linux系统省略输入用户名密码1、省略密码验证 很简单,只需把/etc/passwd中的root:x:0:0:root:/root:/bin/bash,改为root::0:0:root:/root:/bin/ba...
分类:
其他好文 时间:
2015-01-20 15:36:38
阅读次数:
174
前提:安装centos的时候,最好把系统的所有的安装包都安装上。以下命令需手动输入,不要复制粘贴。1.以root用户登录centos5.5的操作系统;创建oracle用户组和用户。groupadd oinstalluseradd –g oinstall –s /bin/bash –d /opt/or...
分类:
数据库 时间:
2015-01-20 13:39:10
阅读次数:
235
1 #!/bin/bash 2 3 if [ $# -ne 1 ] 4 then 5 echo 'please input one ' 6 fi 7 path=$1 8 declare -A wow 9 10 while read line;11 do 12 ftype=`fil...
分类:
其他好文 时间:
2015-01-19 20:41:39
阅读次数:
149
#!/bin/bash#data2015-01-19#autoerlrmiptables-Fiptables-F-tnatiptables-Xiptables-PINPUTDROPiptables-POUTPUTACCEPTiptables-PFORWARDACCEPT######################loadconnection-trackingmodulesmodprobeiptable_natmodprobeip_conntrack_ftpmodprobeip_nat_ftp#########..
分类:
Web程序 时间:
2015-01-19 19:18:41
阅读次数:
153