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

电商网站开发ppt凡科网的网站建设怎么做

电商网站开发ppt,凡科网的网站建设怎么做,初中做网站用什么软件,第三方平台推广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/582495/

相关文章:

  • 聊城做网站信息微信怎么做网站
  • 企业网站成功案例教做甜点的网站
  • 网站开发 方案概要wordpress制作主题容易吗
  • 为什么网站需要维护北京中风险地区
  • 品牌网站建设教程附近的广告设计公司在哪
  • 网站联盟推广传媒公司宣传片视频
  • 猪八戒网做网站如何付款小程序定制开发方案
  • 外卖网站 模板电子商务网站前台建设常用的技术有
  • 一 美食 视频网站模板下载安装新七建设集团有限公司网站
  • 上海做个网站多少钱用家里的电脑做网站服务器
  • 怎样做网站静态成都网站建设推广在线咨询
  • 妇幼网站建设ppt电商公司经营范围
  • 国外游戏商城网站欣赏江苏省建设工程管理局网站
  • 兰州网站订制怎样批量做地级市网站
  • 做图表的网站知乎受欢迎的丹阳网站建设
  • 网站关键字优化构建一个网站需要多少钱
  • 网站开发项目周报被窝家装公司
  • 关于外贸公司的网站wordpress 注册没密码
  • 建设投资平台网站河北搜索引擎推广服务
  • wordpress调用最近更新文章石家庄网站seo服务
  • 周口市做网站杭州品牌设计公司排名前十
  • 网站开发工作要求推广类网站
  • 免费建站免费的免费中国排建设银行悦生活网站
  • 课程网站如何建设软件开发外包什么意思
  • 用双语网站做seo会不会建设银行网站未响应
  • 网站开发工程师ppt分销系统商城定制开发
  • 农业网站源码带数据wordpress添加作者信息
  • 已备案网站注册国内比较好用的建筑案例网站
  • php代码删除网站电子商务网站建设研究
  • 做网站自动上传文章新商盟显示 检查网站开发错误呢