@Great-Chinese
2016-08-10T01:37:15.000000Z
字数 532
阅读 965
linux练习
awk 'ORS=NR%3?" ":"\n"{print}' 1.txt
#!/bin/bashsum=0index=1while [ $index -le $1 ]dosum=$[$sum+$index];index=$[$index+1]doneecho $sum
#!/bin/bashif [ ! -n "$1" ]thenecho "Please input a number" ;exit 0firesult=`echo $1 | grep '^[0-9]*$'`if [ -n "$result" ]thenecho "$1 Is a Number"elseecho "$1 Is Not Number"fi
第一个数1
第二个数2
第三个数3
第四个数5
第五个数8
第六个数13
#!/bin/basha=1b=2i=3while [ $i -le 50 ]doc=$[$a+$b]a=$b;b=$c;i=$[$i+1];echo "$a -> $b -> $c"doneecho $c;
#!/bin/bashfor ((i=1;i<=9;i++))dofor ((j=1;j<=$i;j++))doecho -n "$i*$j="$[$i*$j]" "doneecho ""done
