黑狼linux三期shell中的let与expr计算技巧.pptVIP

  • 0
  • 0
  • 约小于1千字
  • 约 6页
  • 2016-11-21 发布于贵州
  • 举报

黑狼linux三期shell中的let与expr计算技巧.ppt

[~]# let abc = 1 + 1 [~]# echo $abc 2 [~]# expr 1+1 1+1 [~]# expr 1 + 1 1 + 1 [~]# expr a=1 + 1 a=1 + 1 [~]# expr 1 + 1 2 let运算时要加一个引号把运算部分引起来 expr不用加引号就可以直接运算出结果 i=$(( i + 1 )) 使用这种方式也可以计算 主算取得字符串长度: shell expr length this is a test ### 数字商数 shell expr 14 % 9 ### 从位置处抓取字串 shell expr substr this is a test 3 5 ### 数字串 only the first character shell expr index testforthegame e 增量计数 loop=0 loop=`expr $loop + 1` 黑狼linux第三期 *********************************** ********************** *把你的知识分享出来,让你的生活充满快乐。 *******www.E****** ***黑狼linux****** ************************* *免费、分享、共享、共赢* *****

文档评论(0)

1亿VIP精品文档

相关文档