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

做中英文版的网站需要注意什么模板网站合同

做中英文版的网站需要注意什么,模板网站合同,网站维护公司广州,ssh做网站步骤shell的流程控制一般包括if、for、while、case/esac、until、break、continue语句构成。 if语句开发 单分支if //方式1 if <条件表达式> then 代码。。。 fi //方式2 if <条件表达式>;then 代码。。。 fi 双分支if if <条件表达式> then 代码1 if <条件表…

shell的流程控制一般包括if、for、while、case/esac、until、break、continue语句构成。

if语句开发

单分支if
//方式1
if <条件表达式>
then
代码。。。
fi
//方式2
if <条件表达式>;then
代码。。。
fi

双分支if
if <条件表达式>
then
代码1
if <条件表达式>
then
代码2
fi
fi

if-else处理
if <条件表达式>
then
当条件成立,会执行我
else
否则就会执行我
fi
// if-else 多分支处理
if <条件表达式1>
then
代码1
elif <条件表达式2>
then
代码2
elif <条件表达式3>
then
代码3
else
代码4
fi

if 实战
将之前的[] [[]] test条件判断的语句改成if+条件判断的语句
xiao123@xiao123:~/Downloads/shscripts$ [ -f /etc/hosts ] && echo yes
yes
xiao123@xiao123:~/Downloads/shscripts$ [[ -f /etc/hosts ]] && echo yes
yes
xiao123@xiao123:~/Downloads/shscripts$ test -f /etc/hosts && echo yes
yes
xiao123@xiao123:~/Downloads/shscripts$
xiao123@xiao123:~/Downloads/shscripts$ bash ./if_1.sh
[] is ok
[[]] is ok
test is ok
xiao123@xiao123:~/Downloads/shscripts$ cat ./if_1.sh
#! /bin/bashif [ -f /etc/hosts ]thenecho "[] is ok"
fiif [[ -f /etc/hosts ]]; thenecho "[[]] is ok"
fiif test -f /etc/hosts; thenecho "test is ok"
fi
xiao123@xiao123:~/Downloads/shscripts$

开发系统监控脚本

开发shell脚本

  1. 检查Linux剩余可用内存,当可用内存小于100M,就发邮件给运维。
  2. 并且该脚本加入crontab,每3分钟检查一次内存。
xiao123@xiao123:~/Downloads/shscripts$ bash free_1.sh
Current memory is 1081
内存不足,抓紧维护服务器!
xiao123@xiao123:~/Downloads/shscripts$ cat free_1.sh
#! /bin/bashFreeMem=`free -m |awk 'NR==2 { print $NF }'`CHARS="Current memory is ${FreeMem}"if [ "${FreeMem}"  -lt 2100 ];thenecho ${CHARS}|tee /tmp/message.txt# mail -s "主题" 收件人 <# mail -s "`date +%F-%T` ${CHARS}" yc_urrr@163.com < /tmp/message.txtecho "内存不足,抓紧维护服务器!"
fi
xiao123@xiao123:~/Downloads/shscripts$
xiao123@xiao123:~/Downloads/shscripts$ crontab -e
crontab: installing new crontab
xiao123@xiao123:~/Downloads/shscripts$
xiao123@xiao123:~/Downloads/shscripts$ crontab -l
*/3 * * * * /bin/bash /home/xiao123/Downloads/shscripts/free_1.sh
xiao123@xiao123:~/Downloads/shscripts$

if实战开发

单分支实战

xiao123@xiao123:~/Downloads/shscripts$ bash ./if_read.sh  1 2
yes, 1 less than 2
xiao123@xiao123:~/Downloads/shscripts$ bash ./if_read.sh  2 2
yes, 2 equal 2
xiao123@xiao123:~/Downloads/shscripts$ bash ./if_read.sh  3 2
yes, 3 greather than 2
xiao123@xiao123:~/Downloads/shscripts$ cat ./if_read.sh
#! /bin/basha=$1
b=$2if [ $a -lt $b ]; thenecho "yes, $a less than $b"
fiif [ $a -eq $b ]; thenecho "yes, $a equal $b"
fiif [ $a -gt $b ]; thenecho "yes, $a greather than $b"
fi
xiao123@xiao123:~/Downloads/shscripts$

多分支实战

xiao123@xiao123:~/Downloads/shscripts$ bash ./if_read.sh  1 1
yes, 1 equal 1
xiao123@xiao123:~/Downloads/shscripts$ bash ./if_read.sh  1 2
yes, 1 less than 2
xiao123@xiao123:~/Downloads/shscripts$ bash ./if_read.sh  2 1
yes, 2 greather than 1
xiao123@xiao123:~/Downloads/shscripts$ cat ./if_read.sh
#! /bin/basha=$1
b=$2if [ $a -lt $b ]; thenecho "yes, $a less than $b"
elif [ $a -eq $b ]; thenecho "yes, $a equal $b"
elif [ $a -gt $b ]; thenecho "yes, $a greather than $b"
fi
xiao123@xiao123:~/Downloads/shscripts$
http://www.yayakq.cn/news/166230/

相关文章:

  • 网站关键词seo费用wordpress手机版侧栏导航
  • iis提示网站建设中北京企业网站设计公司
  • 网络工程师证站长工具之家seo查询
  • 管理系统网站wordpress 评论 重复
  • 请上传网站应用水印图片河南濮阳建设局网站
  • 安阳网站哪家做的好网站建设生意怎么样
  • 手机定制网站社保扣款怎么在社保网站上做》
  • 网站开发建设及推广合同wordpress 邮件配置文件
  • 网站建设20推广企业怎么建设自己的网站首页
  • 常德网站建设技术网上怎么样挣钱
  • 连江网站建设江油专业网站建设咨询
  • 太原建站塔山双喜河津网站制作
  • 公司电商网站建设方案wordpress 调用作者
  • 电子产品网站模板wordpress视频播放列表页
  • 五种类型网站龙华网站推广培训
  • 随州网站推广哪家专业中化建工北京建设投资有限公司网站
  • 网站主机购买东莞网站优化哪家好
  • wordpress搭建多个购物网站石家庄公司网站设计
  • 大屏手机网站wordpress免费主题怎么用
  • 苏州网站建设套餐重庆关键词优化软件
  • 网站开发公司杭州网站建设做企业邮箱的网站
  • 贵阳市住房和城乡建设部网站百度优化点击软件
  • 自适应网站方案淮南服装网站建设费用
  • 成品网站源码1688免费推荐tplink域名申请
  • 医院的网站关键词定位一般是什么wordpress 图片调用api接口
  • 阿里巴巴网站首页怎么制作个人简历表
  • 家政服务 技术支持 东莞网站建设湘潭网站优化公司
  • 公司建网站流程织梦网站主页
  • 遵义做网站的网络公司男女做污视频在线观看网站
  • 公司网站推广运营移动互联网开发课程