Enviado em 30/10/2016 - 22:03h
Galera quando executo o seguinte comando:sh start.sh
1 #!/bin/tcsh
2
3 set wait = 0
4 set host = "localhost"
5 set team = "CmorQ2009"
6 set prog = "bin/CmorQ_player"
7 set coach = "bin/CmorQ_coach"
8 set pconf = "Configs/player.conf"
9 set fconf = "Configs/formations.conf"
10
11
12 if( $#argv > 0 && ($argv[$#argv] !~ [0123456789]* || $argv[$#argv] =~ *.* ) ) then
13 @ second_last = $#argv - 1
14 if( $#argv > 1 && ($argv[$second_last] !~ [0123456789]* || $argv[$second_last] =~ *.* ) ) then
15 set host = $argv[$second_last]
16 set team = $argv[$#argv]
17 else
18 set host = $argv[$#argv]
19 endif
20 endif
21
22 if( $1 =~ [0123456789]* && $1 !~ *.* ) then
23 echo "$argv[$#argv]"
24 echo "$1"
25 foreach arg ($argv)
26 if( $arg =~ [123456789]* && $arg !~ *.*) then
27 ${prog} -num ${arg} -host ${host} -team ${team} -f ${fconf} -c ${pconf} &
28 sleep $wait
29 else if( $arg =~ [0]* ) then
30 sleep 2
31 ${coach} -host ${host} -team ${team} -f ${fconf} &
32 endif
33 end
34 else
35 set i = 1
36 while ( ${i} <12 )
37 ${prog} -log 101 -number ${i} -host ${host} -team ${team} -f ${fconf} -c ${pconf} &
38 sleep $wait
39 @ i++
40 end
41 sleep 2
42 ${coach} -host ${host} -team ${team} -f ${fconf} &
43 endif