#!/bin/bashlet rnd=$RANDOM%9+1
whiletrue;doread -p "guess a integer less than ten:" input
if(( $input < $rnd ));thenecho"your input is too small."elif(( $input > $rnd ));thenecho"your input is too big."elseecho"right input."breakfidone
3.用文件名做为参数,统计所有参数文件的总行数
#!/bin/bashdeclare -i sum=0
until[[ -z $1]];doif[[ -f $1]];thendeclare -i rows=$(cat $1 |wc -l)let sum+=$rowsshiftelseecho"not a file."breakfidoneecho"the sum of all files's rows is $sum."