[root@LAMP ~]# ((a=1+2**3-4%3))
[root@LAMP ~]# echo $a
8
[root@LAMP ~]# b=$((1+2**3-4%3))
[root@LAMP ~]# echo $b
8
[root@LAMP ~]# echo $((a+=1))
9
[root@LAMP ~]# echo $((a*=2))
18
[root@LAMP ~]# echo $a
18
[root@LAMP ~]# echo $((a%=2))
0
[root@LAMP ~]# echo $((a+=8))
8
[root@LAMP ~]# echo $((a/=2))
4
[root@LAMP ~]# echo $((a++))
4
[root@LAMP ~]# echo $a
5
[root@LAMP ~]# echo $((a++))
5
[root@LAMP ~]# echo $a
6
[root@LAMP ~]# echo $((a--))
6
[root@LAMP ~]# echo $a
5
[root@LAMP ~]# echo $((++a))
6
[root@LAMP ~]# echo $a
6
[root@LAMP ~]# echo $((--a))
5
[root@LAMP ~]# echo $a
5
[root@LAMP ~]# echo $((3>1))
1
[root@LAMP ~]# echo $((3<1))
0
[root@LAMP script]# i=2
[root@LAMP script]# let i=i*3
[root@LAMP script]# echo $i
6
[root@LAMP script]# expr length "byrd"
4
[root@LAMP script]# expr substr "byrd" 2 2
yr
[root@LAMP test]# seq -s " " 100
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
[root@LAMP test]# echo ${#chars}
291
[root@LAMP test]# echo $(expr length "$chars")
291
[root@LAMP test]# expr length "$chars"
291
[root@LAMP test]# echo {chars}|wc -L
291
[root@LAMP test]# time for i in $(seq 50000);do count=`echo ${#chars}`;done;
real 0m22.605s
user 0m1.416s
sys 0m5.814s
[root@LAMP test]# time for i in $(seq 50000);do count=`echo {chars}|wc -m`;done;
real 1m25.007s
user 0m2.362s
sys 0m8.060s
[root@LAMP test]# time for i in $(seq 50000);do count=`expr length "{chars}"`;done;
real 0m46.205s
user 0m2.646s
sys 0m10.198s
[root@LAMP test]# time for i in $(seq 50000);do count=`echo expr length "{chars}"`;done;
real 0m25.122s
user 0m1.794s
sys 0m6.744s
[root@LAMP test]# time for i in $(seq 50000);do count=`expr length "{chars}"`;done;
real 0m46.836s
user 0m3.100s
sys 0m10.740s
[root@LAMP test]# time for i in $(seq 50000);do count=`echo {chars}|wc -L`;done;
real 1m31.203s
user 0m3.148s
sys 0m12.504s
[root@LAMP test]# echo "obase=2;205"|bc
11001101
[root@LAMP test]# echo "obase=8;205"|bc
315
[root@LAMP test]# echo "obase=10;205"|bc
205
[root@LAMP test]# echo "obase=16;205"|bc
CD
[root@LAMP test]# seq -s "+" 100
1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100
[root@LAMP test]# seq -s "+" 100|bc
5050
[root@LAMP test]# echo {1..100}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
[root@LAMP test]# echo {1..100}|tr " " "+"
1+2+3+4+5+6+7+8+9+10+11+12+13+14+15+16+17+18+19+20+21+22+23+24+25+26+27+28+29+30+31+32+33+34+35+36+37+38+39+40+41+42+43+44+45+46+47+48+49+50+51+52+53+54+55+56+57+58+59+60+61+62+63+64+65+66+67+68+69+70+71+72+73+74+75+76+77+78+79+80+81+82+83+84+85+86+87+88+89+90+91+92+93+94+95+96+97+98+99+100
[root@LAMP test]# echo {1..100}|tr " " "+"|bc
5050
[root@LAMP test]# typeset -i A=1 B=3
[root@LAMP test]# A=A+B
[root@LAMP test]# echo $A
4
[root@LAMP test]# echo $[2+3]
5
[root@LAMP test]# echo $[ 2 + 3 ]