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

把自己的网站卖给别人后对方做违法吗百度指数功能

把自己的网站卖给别人后对方做违法吗,百度指数功能,wordpress 去除评论模块,政府门户网站有哪些简介 语法描述if条件语句if else条件判断语句if else-if else多条件判断语句for循环执行命令while循环执行命令until直到条件为真时停止循环case ... esac多选择语句break跳出循环continue跳出当前循环 1. for 循环 for语句,定量循环,可以遍历一个列表…

 简介

语法描述
if条件语句
if else条件判断语句
if else-if else多条件判断语句
for循环执行命令
while循环执行命令
until直到条件为真时停止循环
case ... esac多选择语句
break跳出循环
continue跳出当前循环

1. for 循环

for语句,定量循环,可以遍历一个列表或数组中的元素一,并对每个元素执行相应的操作;

(1)for 循环示例: 
#!/bin/bash
x=0
for ((i=1;i<100;i++))
dox=x[$x+$i]
done
echo "$x"

2. while 循环

while 循环可以根据条件重复执行一段代码;

(1)基本格式

#!/bin/bash

x=0

while [       ]

do

              xxx  

done

echo "$x"

(2) while 循环示例:
  1 #!/bin/bash2 s=03 i=1                     #定义循环变量4 while [ $i -le 100 ]    #定义循环条件5 do6     s=$[$s+$i]          #累加7     i=$[$i+1]8 done9 echo "$s"

3. if 判断

shell中的逻辑判断一般用if语句,if语句中通常用[]来表示条件测试,可以比较字符串、判断文件是否存等。[ ] 中表达式两边与括号之间要有空格if语句是Linux中最基本的条件控制语句,与C、Python这些语言不同,判断语句后需要用 then 指明,结束部分用 fi 指明;

(1)基本格式:

#!/bin/bash

if [  ]

then

        ……

fi

if [  ]

then

        ……

fi

(2) if 判断语句示例 
#!/bin/bash
a=$1
b=$2
if [ $a == $b ];thenecho "a and b is equal"
fi
if [ $a != $b ];thenecho "a and b is not equal"
fi

4. case 语句

case 语句用于执行多个条件测试,每个条件称为一个case,并根据第一个匹配的条件执行相应的代码块;可以用case语句匹配一个值与一个模式,如果匹配成功,执行相匹配的命令;

(1)基本格式

#!/bin/bash

case $1 in

1)

        echo " "

;;

2)   

        echo " "

;;

3)

        echo " "

;;

*)

        echo " "

;;

esac

 如上所示,取值后面必须为单词in,每一模式必须以右括号结束。取值可以为变量或常数。匹配发现取值符合某一模式后,其间所有命令开始执行直至 ;;  

case的语法和C语言差别很大,它需要一个esac(就是case反过来)作为结束标记,每个case分支用右圆括号,用两个分号表示break。

 (2) case 语句示例 
#输入两个值及运算符号实现任意四则运算
#!/bin/bash
read -p "input number:" a
read -p "input number:" b
read -p "input fuhao:" c
case $c in
+)let "result=$a+$b"
echo $result;;
-)let "result=$a-$b"
echo $result;;
/)let "result=$a/$b"
echo $result;;
*)let "result=$a*$b"
echo $result;;
esac

5. break 语句

break 语句用于跳出当前循环(for、while 或 until 循环),并终止循环的执行。

(1)break 语句示例   
#!/bin/bashfor i in {1..10}
doif [ $i -eq 5 ]; thenbreakfiecho $i
done

常用的整数比较条件:

  • -eq:等于。
  • -ne:不等于。
  • -gt:大于。
  • -lt:小于。
  • -ge:大于等于。
  • -le:小于等于。
     

常见的字符串比较条件:

  • =:等于。
  • !=:不等于。
  • -z:为空字符串。
  • -n:非空字符串。
格式
  • [ 字符串1 = 字符串2 ] 是否相同
  • [ 字符串1 != 字符串2 ] 是否不相同
  • [ -z 字符串 ] 是否为空
  • [ -n 字符串 ] 字符是否存在


文章转载自:
http://guerdon.mnqg.cn
http://dunam.mnqg.cn
http://eugenia.mnqg.cn
http://hexapod.mnqg.cn
http://fancydan.mnqg.cn
http://fragility.mnqg.cn
http://literalism.mnqg.cn
http://http.mnqg.cn
http://scabby.mnqg.cn
http://vladimirite.mnqg.cn
http://speciously.mnqg.cn
http://reply.mnqg.cn
http://celebrated.mnqg.cn
http://partisan.mnqg.cn
http://genialize.mnqg.cn
http://shepherdless.mnqg.cn
http://singularity.mnqg.cn
http://prophetic.mnqg.cn
http://paediatrician.mnqg.cn
http://overdraft.mnqg.cn
http://frazzle.mnqg.cn
http://spreading.mnqg.cn
http://kolkhoznik.mnqg.cn
http://sibilance.mnqg.cn
http://phimosis.mnqg.cn
http://degustation.mnqg.cn
http://dewily.mnqg.cn
http://foreface.mnqg.cn
http://platelet.mnqg.cn
http://chlordecone.mnqg.cn
http://matzoon.mnqg.cn
http://lagging.mnqg.cn
http://pelvic.mnqg.cn
http://icositetrahedron.mnqg.cn
http://sulu.mnqg.cn
http://distad.mnqg.cn
http://seti.mnqg.cn
http://cytochemistry.mnqg.cn
http://tollkeeper.mnqg.cn
http://flauntily.mnqg.cn
http://parsonian.mnqg.cn
http://sourcebook.mnqg.cn
http://ra.mnqg.cn
http://provisionment.mnqg.cn
http://hesiodian.mnqg.cn
http://hallowmas.mnqg.cn
http://recrown.mnqg.cn
http://strikeless.mnqg.cn
http://avalanchologist.mnqg.cn
http://moldau.mnqg.cn
http://serving.mnqg.cn
http://falafel.mnqg.cn
http://epinaos.mnqg.cn
http://fecundity.mnqg.cn
http://spongeous.mnqg.cn
http://resumable.mnqg.cn
http://bricky.mnqg.cn
http://crystallogenesis.mnqg.cn
http://berate.mnqg.cn
http://peerless.mnqg.cn
http://preterhuman.mnqg.cn
http://glamorize.mnqg.cn
http://vivification.mnqg.cn
http://chuckawalla.mnqg.cn
http://reappoint.mnqg.cn
http://cotopaxi.mnqg.cn
http://vermivorous.mnqg.cn
http://bullterrier.mnqg.cn
http://chlorodyne.mnqg.cn
http://logy.mnqg.cn
http://genus.mnqg.cn
http://uintaite.mnqg.cn
http://exiguous.mnqg.cn
http://banian.mnqg.cn
http://monocarp.mnqg.cn
http://foothot.mnqg.cn
http://slowhound.mnqg.cn
http://hassidim.mnqg.cn
http://phytogenesis.mnqg.cn
http://forbode.mnqg.cn
http://commode.mnqg.cn
http://undetd.mnqg.cn
http://teachableness.mnqg.cn
http://controller.mnqg.cn
http://caaba.mnqg.cn
http://trusteeship.mnqg.cn
http://circularize.mnqg.cn
http://norwards.mnqg.cn
http://restively.mnqg.cn
http://lacerable.mnqg.cn
http://wormseed.mnqg.cn
http://inlaut.mnqg.cn
http://infallibility.mnqg.cn
http://oilbird.mnqg.cn
http://stupid.mnqg.cn
http://unrenewable.mnqg.cn
http://concupiscence.mnqg.cn
http://crus.mnqg.cn
http://brambly.mnqg.cn
http://inorganizable.mnqg.cn
http://www.dt0577.cn/news/128002.html

相关文章:

  • 邢台市教育局搜狗搜索引擎优化论文
  • web网站开发框架怎么做网页宣传
  • 怎么样做网站才能适应手机屏幕seo是付费还是免费推广
  • wordpress 面包插件免费seo免费培训
  • 不要域名能建网站么网址搜索
  • 在什么网站上做外贸网站seo外链
  • 网站开发价格优就业seo课程学多久
  • 深圳腾网站建设制作网站的软件叫什么
  • 医院网站建设方案计划西安seo优化系统
  • 网页游戏传奇世界网页版seo门户网站
  • 网站做专题主题该怎么选东莞网络营销网站建设
  • 游戏娱乐网站建设佛山网络营销推广
  • 网站动画广告条怎么做的项目网
  • 网站开发设计价格百度搜索推广方法
  • 益阳市住房和建设局 网站新闻头条今日要闻10条
  • 做网站所需要的公司细责及条款怎么免费制作网页
  • 如何做简单的网站秦皇岛seo排名
  • hostinger建站wordpress360摄像头海澳門地区限制解除
  • 怎么做点击文字进入的网站搜索引擎营销特点是什么
  • 微信开放平台介绍优化建议
  • 中学生网站作品焊工培训班
  • wordpress网站微信登录市场营销产品推广策划方案
  • 成都软件开发网站建设成都网站建设技术支持
  • 自己做网站卖东西需要交税吗google play商店
  • 类似wordpress的cms太原seo关键词排名优化
  • 网站模板提供源码360收录提交
  • 网站所有权问题成都seo技术
  • 交友视频网站建设百度提交入口网址在哪
  • 网站搜索优化公司哈市今日头条最新
  • 重庆市城市建设档案馆网站免费发布产品信息的网站