1 #!/bin/sh
2
3 views=`cleartool lsview | grep ${USER}`
4
5 echo ""
6 printf "Views:"
7 echo ""
8
9 declare -a myview
10
11 i=1
12 for view in ${views}
13 do
14 if echo ${view} | grep "$USER" | grep -q '.*[^.vws]$'
15 then
16 printf "%d : %s\n" ${i} ${view}
17 myview[$i]=${view}
18 # echo ${myview[$i]}
19 let i=$i+1
20 fi
21 done
22
23 printf "Please input number:\n"
24 read no
25
26
27 while [ "${no}" -ge "${i}" ]
28 do
29 echo "Warning:${no} is invalid"
30 echo "Please input number:"
31 read no
32
33 done
34
35 if [ "${no}" -lt "${i}" ]
36 then
37 cleartool setview ${myview[${no}]}
38 fi
阅读(581) | 评论(0) | 转发(0) |