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
|
#!/bin/bash
while
: ;
do
read
-p
"do you continue(y/n):"
k
case
$k
in
y )
read
-p
"u input the number:"
n
if
[ $n -lt 6 ]
then
m=`
seq
$n 5`
echo
$m
elif
[ $n -gt 5 ] && [ $n -lt 16 ]
then
m1=`
seq
$n 15`
echo
$m1
fi
continue
;;
n )
exit
;;
* )
echo
"你输入错误,请重新输入"
;;
esac
done
fi
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
kl(){
read
-p
"input a pause num:"
i
read
-p
"input a pause num:"
xi
for
((i=$i;i<=$xi;i++))
do
echo
-e
"$i \c"
done
echo
}
while
:
do
read
-p
"continue?(y|n)"
yes
if
[
"$yes"
=
"y"
]
then
kl
else
exit
1
fi
done
|
本文转自wsw26 51CTO博客,原文链接:http://blog.51cto.com/wsw26/1755272,如需转载请自行联系原作者