csh脚本:
chengqi@chengqi-PC /cygdrive/d/test
$ cat ceshi.sh
#!/bin/csh
set first_num=$1
echo $1\\n$2\\n$3\\n$4\\n$5\\n$6\\n$7\\n$8\\n$9\\n$10 | awk 'BEGIN{max="'$first_num'";min="'first_num'"}{if($1>max){max=$1};if($1<min){min=$1}}END{pri
nt "the max number is "max;print "the min number is "min}'
执行结果:
chengqi@chengqi-PC /cygdrive/d/test
$ ./ceshi.sh 11 31 23 34 64 1 45 20 32 14
the max number is 64
the min number is 1
追问执行不了,大哥。在虚拟机上截个图看看。
追答我写的都是验证过的
-_-!