#!/bin/bash
for i in `ls`
do [[ $i =~ ..*\.sh$ ]] && chmod +x $i
done
#!/bin/bash
[[ ! $i =~ ^[0-9]+$ ]] && echo $i is not digit
uid1=`head -10 /etc/passwd |tail -1|cut -d: -f3`
uid2=`head -20 /etc/passwd |tail -1|cut -d: -f3`
sum=$[${uid1}+${uid2}]
echo $sum
sort大小排序 tr cut head tail 用法
#!/bin/bash
a=`df -h |grep sd|tr -s ' ' '%'|cut -d% -f5|sort -nr |head -1`
[ $a -ge 80 ] && echo "disk wall oooooo" || echo every thing is ok