expr 可以用于计算

[root@rhel6 script]# expr *
*
[root@rhel6 script]#

使用expr来判断输入的变量是否为整数, 注意这里的&表示  安静模式(没有输出)

[root@rhel6 script]# i=
[root@rhel6 script]# expr $i + &>/dev/null
[root@rhel6 script]# echo $? [root@rhel6 script]# k=abc
[root@rhel6 script]# expr $k + &>/dev/null
[root@rhel6 script]# echo $?

使用expr计算字符串的长度

[root@rhel6 script]# echo $i

[root@rhel6 script]# expr length $i

最新文章

  1. Freemarket学习整理。
  2. 验证时出错。HRESULT = '8000000A'
  3. 12个css高级技巧.html
  4. 保存登录信息的Cookie加密技术
  5. Oracle RAC OCR 与健忘症
  6. Hadoop与分布式开发
  7. Nginx源码研究五:NGINX的配置信息管理
  8. 数组有没有 length()这个方法? String 有没有 length()这 个方法?
  9. IOS 消息
  10. Web开发者の实用代码账簿
  11. 第三节,目标检测---R-CNN网络系列
  12. 【XSY2772】数列 特征多项式 数学
  13. javascript数组(五)
  14. Zepto tap 穿透bug、解决移动端点击穿透问题
  15. svg相关
  16. hdu4407 Sum 容斥原理
  17. CF 1114 D. Flood Fill
  18. CTreeCtrl 父结点联动子结点CheckBox
  19. java.util.logging.Logger日志生成过程浅析 (转)
  20. vue中动态添加div

热门文章

  1. unity3d WebPlayer版本号音效无声音问题
  2. 50 years of Computer Architecture: From the Mainframe CPU to the Domain-Specific TPU and the Open RISC-V Instruction Set
  3. 使用jstl标签报错:According to TLD or attribute directive in tag file, attribute value
  4. Y2K Accounting Bug - 2586
  5. Centos命令行报bash:.....:command not found的解决办法
  6. PHP-Manual的学习----【序言】
  7. A/B(逆元)
  8. Stacks of Flapjacks(栈)
  9. EasyDSS流媒体服务器灵活地帮助用户实现摄像机RTSP转RTMP直播功能
  10. python的进程和线程