建设电子商务网站流程做母婴的网站
- 作者: 五速梦信息网
- 时间: 2026年03月21日 10:44
当前位置: 首页 > news >正文
- xiao123xiao123:~/Downloads/shscripts$模式匹配 2个特殊符号
- 冒号计算字符串字符的数量Yuchao 6个字符.* 任意字符重复0次或者多次 语法 expr 字符串 “:” “.” xiao123xiao123:~/Downloads/shscripts$ expr yc.png : . 6 xiao123xiao123:/Downloads/shscripts$ expr yc.png : .* #统计文件中字符个数 6 xiao123xiao123:/Downloads/shscripts\( expr yc.png : .*j #最后的模式可以自定义 0 xiao123xiao123:~/Downloads/shscripts\) expr yc.png : p.* #最后的模式可以自定义 0 xiao123xiao123:/Downloads/shscripts$ expr yc.png : y.* #最后的模式可以自定义 6 xiao123xiao123:/Downloads/shscripts\( expr yc.png : .*p #最后的模式可以自定义 4 xiao123xiao123:~/Downloads/shscripts\)脚本开发 需求执行脚本传入一个文件名然后判断该文件是否是jpg图片文件 xiao123xiao123:/Downloads/shscripts$ ./expr_test.sh chaochao_1.jpg 这的确是chaochao_1.jpg结尾的文件 xiao123xiao123:/Downloads/shscripts\( cat ./expr_test.sh #! /bin/bashif expr \)1 : .*.jpg /dev/nullthenecho 这的确是\(1结尾的文件 elseecho 这不是jpg结尾的文件 fi xiao123xiao123:~/Downloads/shscripts\)找出长度不大于为5的单词 xiao123xiao123:/Downloads/shscripts$ ./expr_test1.sh I am Yu I you to xiao123xiao123:/Downloads/shscripts\( cat ./expr_test1.sh #! /bin/bashfor str1 in I am Yu chao, I teach you to learn linux.doif [ expr length \){str1} -lt 5 ]thenecho \({str1}fidone xiao123xiao123:~/Downloads/shscripts\)bc 命令 bc计算器 awk支持数值计算 中括号运算 bc当作计算器来用的命令行的计算器。 例子1 xiao123xiao123:/Downloads/shscripts$ bc bc 1.07.1 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type warranty. 22 4 4*4 16 1-1 0 1-2 -1 2.24⁄2 1 2.2⁄2.0 1 2.22-1.1 1.12 ^C (interrupt) use quit to exit. exit 0 ^C (interrupt) use quit to exit. quit xiao123xiao123:/Downloads/shscripts\(例子2 xiao123xiao123:~/Downloads/shscripts\) num5 xiao123xiao123:/Downloads/shscripts\( echo \){num}*5 | bc 25 xiao123xiao123:/Downloads/shscripts\(案例 计算出1-1000的总和 数学公式 1234…100 xiao123xiao123:~/Downloads/shscripts\) echo {1..100} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 xiao123xiao123:/Downloads/shscripts$ #tr 替换 xiao123xiao123:/Downloads/shscripts\( echo {1..100} | tr #方案1 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 xiao123xiao123:~/Downloads/shscripts\) seq -s 100 #方案2 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 xiao123xiao123:/Downloads/shscripts$ xiao123xiao123:/Downloads/shscripts\( echo {1..100} | tr | bc 5050 xiao123xiao123:~/Downloads/shscripts\) xiao123xiao123:/Downloads/shscripts\( echo \)((echo {1..100} | tr )) 5050 xiao123xiao123:/Downloads/shscripts\( xiao123xiao123:~/Downloads/shscripts\) seq -s 100 | xargs expr 5050 xiao123xiao123:/Downloads/shscripts$awk计算 awk支持小数计算。 xiao123xiao123:/Downloads/shscripts\( seq -s 100 | xargs expr 5050 xiao123xiao123:~/Downloads/shscripts\) echo 2.2 3.0 | awk {print \(1*\)2} 6.6 xiao123xiao123:/Downloads/shscripts\( echo 2.2 3.0 | awk {print (\)1*$2)} 6.6 xiao123xiao123:/Downloads/shscripts\( echo 2.2 3.0 | awk {print (\)1\(2)4} 10.6 xiao123xiao123:~/Downloads/shscripts\) echo 2.2 3.0 | awk {print $1\(24} 10.6 xiao123xiao123:~/Downloads/shscripts\)中括号计算 \([表达式] xiao123xiao123:~/Downloads/shscripts\) num5 xiao123xiao123:/Downloads/shscripts\( res\)[num4] xiao123xiao123:/Downloads/shscripts\( echo \){res} 9 xiao123xiao123:/Downloads/shscripts\( res\)[num-4] xiao123xiao123:/Downloads/shscripts\( echo \){res} 1 xiao123xiao123:/Downloads/shscripts\( res\)[num*4] xiao123xiao123:/Downloads/shscripts\( echo \){res} 20 xiao123xiao123:/Downloads/shscripts\( res\)[num/4] xiao123xiao123:/Downloads/shscripts\( echo \){res} 1 xiao123xiao123:~/Downloads/shscripts$
相关文章
-
建设电子商务网站的基本步骤网站后台登陆显示验证码错误
建设电子商务网站的基本步骤网站后台登陆显示验证码错误
- 技术栈
- 2026年03月21日
-
建设电子商务网站必须首先确定的是如何创建网站页面
建设电子商务网站必须首先确定的是如何创建网站页面
- 技术栈
- 2026年03月21日
-
建设电影网站数据库脚本wordpress怎么启用经典编辑器
建设电影网站数据库脚本wordpress怎么启用经典编辑器
- 技术栈
- 2026年03月21日
-
建设电子商务网站前的市场分析wordpress瀑布流主题怎么设置首页显示文章数量
建设电子商务网站前的市场分析wordpress瀑布流主题怎么设置首页显示文章数量
- 技术栈
- 2026年03月21日
-
建设电子商务网站市场分析扒wordpress
建设电子商务网站市场分析扒wordpress
- 技术栈
- 2026年03月21日
-
建设钓鱼网站平面设计好学吗?没有基础
建设钓鱼网站平面设计好学吗?没有基础
- 技术栈
- 2026年03月21日
