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
27
28
29
30
31
32
33
34
35
36
|
#!/bin/bash
####test 1 to 4 option
###by Wang
while
:;
do
read
-p
"input 1 to 4 between:"
a
n=`
echo
$a |
sed
's/[^0-9]//g'
`
case
$n
in
1)
echo
"*cmd meau** : `date`"
exit
;;
2)
echo
"*cmd meau**: `ls`"
exit
;;
3)
echo
"*cmd meau**: `who`"
exit
;;
4)
echo
"*cmd meau**: `pwd`"
exit
;;
*)
echo
"u input is not for us option"
if
[ -z $n ]
then
echo
"please input again"
elif
[ $n -gt 5 ]
then
exit
fi
;;
esac
done
|
本文转自wsw26 51CTO博客,原文链接:http://blog.51cto.com/wsw26/1764100,如需转载请自行联系原作者