-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake.sh
More file actions
55 lines (48 loc) · 1.08 KB
/
make.sh
File metadata and controls
55 lines (48 loc) · 1.08 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#! /bin/bash
set -- $(getopt t "$@")
case $1 in
-t)
if [ "$3" != "cli" ] && [ "$3" != "com" ]; then
if [ -z "$3" ]; then
echo you have to choice below
else
echo $3 is wrong value
echo -e "you have to choice below by option -t with cli or com"
fi
echo "case1) ./make.sh -t cli"
echo "case2) ./make.sh -t com"
exit 0
fi
;;
--)
exit 0
;;
*)
echo $1 is not an option
exit 0
;;
esac
read -p "Command : " command
read -p "Key : " key
read -p "Score: " score
read -p "Member: " member
read -p "Range: " range
type="$3"
i=0
if [ $type = "cli" ]; then
while [ $i -le $range ]
do
echo $command $key $score${i} $member${i} >> ./cli-pipe.txt
i=`expr $i + 1`
done
else
printf '%s ' $command $key >> ./command.txt
while [ $i -le $range ]
do
printf '%s ' "$score${i} '$member${i}'" >> ./command.txt
i=`expr $i + 1`
done
fi
wait
echo "All process are done"
exit 0