码迷,mamicode.com
首页 > 系统相关 > 详细

linux shell program summary

时间:2016-09-23 21:19:05      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

from:Sep 23 2016


 

mathematical operation:

技术分享

floating number,bc calculator:

技术分享

we can also use bc in shell scripts:

技术分享


 

if - then - else

number comparison:

              n1 -eq n2

              n1 -ge n2

              n1 -gt n2

              n1 -le n2

              n1 -lt n2

              n1 -ne n2

技术分享

if - then - elif, notice that the second elif won‘t be executed, though it‘s also right.

技术分享


 

strings comarison:

                          str1 = str2

                          str1 != str2

                          str1 < str2

                          str1 /> str2

                          -n str1

                          -z str1

技术分享


 

linux shell program summary

标签:

原文地址:http://www.cnblogs.com/rixiang/p/5901493.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!