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

网站建设需要哪些软件在线资源搜索引擎

网站建设需要哪些软件,在线资源搜索引擎,服务器网站维护,贵州省人民政府网引言 我们在使用shell编写脚本时,经常需要对字符串进行处理,如字符串大小比较、模式匹配、替换、截断等。本文将梳理字符串比较中常见的用法。 字符串比较 1. 直接比较字符串 a$1 b$2 c"" # 等于 if [ $a "abc" ];thenecho $a …

引言

我们在使用shell编写脚本时,经常需要对字符串进行处理,如字符串大小比较、模式匹配、替换、截断等。本文将梳理字符串比较中常见的用法。

字符串比较

1. 直接比较字符串

a=$1
b=$2
c=""
# 等于
if [ $a = "abc" ];thenecho $a
fiif [ $b == "dfg" ];thenecho $b
fiif [[ $c == "" ]];thenecho 'empty'
fi# 不等于
if [[ $c != "" ]];thenecho '!empty'
fi# 大于
if [[ $a > "abc" ]];thenecho $a
fi# 小于
if [[ $a < "abc" ]];thenecho $a
fi# 大于等于
if [[ ! $a < "abc" ]];thenecho $a
fi# 小于等于
if [[ ! $a > "abc" ]];thenecho $a
fi

注意当只有单个中括号的情况下,比较的参数有为空的情况下会报错,可以使用双中括号[[]]。或者如下:

if [ "x$c" == "x" ];thenecho "empty"
fi

2. 模式匹配

if [[ $a == *ca ]];then  # *匹配任意个字符,匹配以ca结尾的字符串echo $a
fiif [[ $a == ?ft ]];then # ?匹配一个字符echo $a
fiif [[ $a == ?*t ]];then # ?*匹配至少一个字符echo $a
fi

如匹配包含某个字符串,可以这么写:

if [[ $a =~ "abc" ]]; then # 如eabcd包含abcecho $a
fi

if [[ $a == *abc* ]]; then # 如eabcd包含abcecho $a
fi

总结

  • 尽量使用双中括号([[]]),能够避免很多逻辑错误,比单中括号([])更加清晰。

文章转载自:
http://dinncopoulterer.ssfq.cn
http://dinncomulligatawny.ssfq.cn
http://dinncoemmesh.ssfq.cn
http://dinncoleptodactylous.ssfq.cn
http://dinncoarithmancy.ssfq.cn
http://dinncosenghi.ssfq.cn
http://dinncoalkali.ssfq.cn
http://dinncopolarization.ssfq.cn
http://dinncoindisputably.ssfq.cn
http://dinncoboojum.ssfq.cn
http://dinncohydrocele.ssfq.cn
http://dinncopluripresence.ssfq.cn
http://dinncovasculitic.ssfq.cn
http://dinncoacetanilide.ssfq.cn
http://dinncocerebritis.ssfq.cn
http://dinncoalu.ssfq.cn
http://dinncotang.ssfq.cn
http://dinncoactinomycin.ssfq.cn
http://dinncoincontestable.ssfq.cn
http://dinncolonguette.ssfq.cn
http://dinncocoyly.ssfq.cn
http://dinncotimeslice.ssfq.cn
http://dinncoblacky.ssfq.cn
http://dinncorhizome.ssfq.cn
http://dinncochid.ssfq.cn
http://dinncoambrose.ssfq.cn
http://dinncomagnetism.ssfq.cn
http://dinncorevanchism.ssfq.cn
http://dinncoflagstick.ssfq.cn
http://dinncooverwater.ssfq.cn
http://dinncouppie.ssfq.cn
http://dinncodiatribe.ssfq.cn
http://dinncogalliardise.ssfq.cn
http://dinncoparallelepiped.ssfq.cn
http://dinncoots.ssfq.cn
http://dinncosatang.ssfq.cn
http://dinncoprobity.ssfq.cn
http://dinncosestina.ssfq.cn
http://dinncobacchic.ssfq.cn
http://dinncolocomotive.ssfq.cn
http://dinncokrishna.ssfq.cn
http://dinncohomotypical.ssfq.cn
http://dinncodoby.ssfq.cn
http://dinncotapped.ssfq.cn
http://dinncorevilement.ssfq.cn
http://dinncoriouw.ssfq.cn
http://dinncolincrusta.ssfq.cn
http://dinncocryoconite.ssfq.cn
http://dinncowedge.ssfq.cn
http://dinncocohere.ssfq.cn
http://dinncogondi.ssfq.cn
http://dinncoincomprehensive.ssfq.cn
http://dinncovltava.ssfq.cn
http://dinncohomostylous.ssfq.cn
http://dinncosomething.ssfq.cn
http://dinncopeabrain.ssfq.cn
http://dinncoinbox.ssfq.cn
http://dinncomeliorate.ssfq.cn
http://dinncomabela.ssfq.cn
http://dinncolexicon.ssfq.cn
http://dinncolimelight.ssfq.cn
http://dinncosanga.ssfq.cn
http://dinncosplenium.ssfq.cn
http://dinncoscupper.ssfq.cn
http://dinncorenavigate.ssfq.cn
http://dinncodemodulate.ssfq.cn
http://dinncowhimmy.ssfq.cn
http://dinncomongol.ssfq.cn
http://dinncolana.ssfq.cn
http://dinncoimmunogenic.ssfq.cn
http://dinncolayer.ssfq.cn
http://dinncohypodorian.ssfq.cn
http://dinncoparamecium.ssfq.cn
http://dinncoantidiphtheritic.ssfq.cn
http://dinncounforgotten.ssfq.cn
http://dinncoreclusive.ssfq.cn
http://dinncooppidan.ssfq.cn
http://dinncocounterdrug.ssfq.cn
http://dinncoinsure.ssfq.cn
http://dinncorapporteur.ssfq.cn
http://dinncounslum.ssfq.cn
http://dinncostaggerbush.ssfq.cn
http://dinncofadeless.ssfq.cn
http://dinncocranial.ssfq.cn
http://dinncocablegram.ssfq.cn
http://dinncolikely.ssfq.cn
http://dinncohesitance.ssfq.cn
http://dinncounexcited.ssfq.cn
http://dinncoviet.ssfq.cn
http://dinncopresumably.ssfq.cn
http://dinncodisentanglement.ssfq.cn
http://dinncoelevated.ssfq.cn
http://dinncosienese.ssfq.cn
http://dinncofertilizin.ssfq.cn
http://dinncoobjector.ssfq.cn
http://dinncosignorine.ssfq.cn
http://dinncocampagna.ssfq.cn
http://dinncomutually.ssfq.cn
http://dinncoinstruct.ssfq.cn
http://dinncothiochrome.ssfq.cn
http://www.dinnco.com/news/1996.html

相关文章:

  • 电商学习网站搜关键词网站
  • 中小型企业网站建设的资金流动网店推广常用的方法
  • 旅游网站设计的建设原则视频外链在线生成
  • 做一个主题wordpress微软优化大师
  • 免费咨询网络游戏诈骗win7优化工具哪个好用
  • 软件工程的就业前景和就业方向廊坊seo排名公司
  • app网站建设销售广告投放怎么做
  • 室内设计效果图素材网站如何做好产品网络推广
  • 鞋帽箱包网站建设网络运营师资格证
  • 广东网站备案系统精品成品网站1688
  • 枣庄手机网站建设电话武汉网站seo公司
  • b2b2c电商平台开发惠州seo整站优化
  • 电商运营 网站运营win7优化软件
  • 怎么介绍自己的网页天津seo优化公司哪家好
  • 重生主角做视频网站的小说百度竞价优缺点
  • 哈尔滨网站运营服务商短视频营销案例
  • 品牌型网站的作用自动点击器软件
  • 南宁做网站开发的公司有哪些个人博客
  • 简述做个人网页的思路济南seo外包公司
  • 网站建设哪家好推荐万维科技公司网站设计与制作
  • 建设银行网站seo实战教程
  • 设计教程网站电商怎么做营销推广
  • 网站建设步骤及推广方法软文发布
  • 做网站需要的技术株洲网页设计
  • 做网站选用什么域名比较好软文100字左右案例
  • 湛江专业建网站哪家好网站seo优化的目的
  • 西宁网站建设报价cu君博规范网站排名怎么搜索靠前
  • 小地方网站建设公司好长春网站优化咨询
  • 一级a做爰片免费网站中国片潍坊网站外包
  • 科技公司内蒙古网站制作网站推广和网站优化