shell笔记(bash与dash)

#!/bin/bash
read -p "input a numbers:" a 
[[ `expr $a : "[0-9]+$"` == 0 ]]&&{
 echo "  not a number " 
}||{ 
echo "   a number "
}
这个例子如果使用#!/bin/sh,即使用的是dash。[[]]中括号使用报错。
bash与dash的区别:[](http://blog.csdn.net/hansel/article/details/9817129) 

学习shell,记住一些特例,当有需要在去查找,然后积累。
为了解决问题而学shell,不是为了单一的学shell。太多资料记不住。

你可能感兴趣的:(linux服务器监控,shell)