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

怎么将自己房子投入网站做民宿电商网站上信息资源的特点包括哪些

怎么将自己房子投入网站做民宿,电商网站上信息资源的特点包括哪些,长沙互联网公司有哪些,搭建网站有什么用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/520753/

相关文章:

  • 电商网站里的图片微信小程序怎么做?
  • 一个网站建设需要多少人力dedecms农业种植网站模板
  • 做网站go和php用哪个好电子商务网站建设的体会
  • 电商实训网站建设报告玉树营销网站建设多少钱
  • 网站怎么连接网简述网站开发设计流程图
  • 网站建设开发熊掌号酷黑网站
  • 建网站素材创建企业手机微信网站门户
  • 做油和米的网站模拟网站平台怎么做
  • 河北云网站建设舟山网站建设推荐
  • 内销网站怎么做科技之星
  • 网站建设维护方向互联网保险和线下保险的区别
  • 如何让百度快速收录网站文章做网站虚拟主机多少钱
  • 百度网站关键词和网址卫生局网站建设实施方案
  • 网站备案 空间备案 域名备案企业不想做网站的原因
  • 网站开发需求单旅游网站建设ppt模板下载
  • 成都网站制作哪家好天津网站建设揭秘
  • 兖矿东华建设网站网站建设的基本步骤
  • 甘肃新站优化外贸网站谷歌优化
  • 如何弄网站佛山做网站
  • 购物网站如何做房天下官方网站
  • 企业网站建设营销seo分析网站
  • seo网站设计联系方式网站老是快照打开
  • 网站开发eq编辑器石家庄做网站排名
  • 网络服务商网站如何做网站上抓视频
  • 境外网站服务器产品设计网址
  • 昆明网站建设 技术支持访问的网站显示建设中
  • 网站做不做301网站建设 永灿 竞争
  • 网站图片最大尺寸佛山市城乡和住房建设局网站
  • 车险网站模版交换友链平台
  • 建企业门户网站大庆做网站