echo -n "Enter three number:"
read a b c
if [ $a -gt $b ];then
t=$a;a=$b;b=$t;
fi
if [ $a -gt $c ];then
t=$a;a=$c;c=$t;
fi
if [ $b -gt $c ];then
t=$b;b=$c;c=$t;
fi
echo "The small number is $a"
echo "The big number is $c"
你没说用什么语言,我选择PERL进行编写,在LINUX上PERL是通用的、最方便的,程序如下:
#!/usr/bin/perl
$line=
$start=$ARGV[0]-1;
$len=$ARGV[1]-$ARGV[0]+1;
print substr($line, $start, $len);
保存为cuts,添加x属性即可。