摘要:
shell中的循环语句for循环for语法格式1:for 变量 in 值1 值2 值3 值4 值5 值6 ... ...do 命令donefor i in 1 88 3 90do echo $1done[root@vh01 script]# vim f.sh#!/bin/bashfor i in 1 阅读全文
摘要:
shell中的if语句格式1:单分支if [ 判断 ];then 命令fi 格式2:双分支if [ 判断 ];then 命令else 命令fi格式3:多分支if [ 判断 ];then 命令elif 命令elif 命令else 命令... ...fi#!/bin/bashnum=$[RANDOM%1 阅读全文
摘要:
shell的测试表达式[ 表达式 ][空格 数字 空格 数字 空格]test 表达式1、字符串测试-z 字串为空 [ -z 字符串 ]!-z字串为非空 [ !-z 字符串 ][root@vh01 ~]# a=12[root@vh01 ~]# [ -z $a ][root@vh01 ~]# echo 阅读全文
摘要:
shell的数值运算整数【3种】1、expr 数字 运算符 数字+ - /* / %取余[root@vh01 script]# expr 2+ 5expr: 语法错误[root@vh01 script]# expr 2 + 57[root@vh01 script]# expr 2 - 5-3[roo 阅读全文
摘要:
Shell 变量ip=192.168.4.254soft=ftpbaseurl=ftp://$ip/rhel6/Serveryum-y install $softservice $soft startchkconfig $soft on变量名称=变量值变量名称:字母,数字,_,但是不能以数字开始相关 阅读全文
摘要:
shell1、什么叫shell在linux内核与用户之间的解释器程序通常指/bin/bash负责向内核翻译及传达用户、程序指令相当于操作系统的“外壳”、2、shell的使用方式交互式 命令行非交互式 脚本硬件 系统软件【内核】 应用软件 人shell, bash, sh, kshshell[命令解释 阅读全文
摘要:
squid(代理服务器) client:192.168.4.1 eth0 squid:192.168.4.5 eth0 192.168.2.5 eth1 web:192.168.2.100 eth1环境配置1、真实机(确认:virbr1(192.168.4.1))web网站【加速】代理软件 varn 阅读全文