File: variables

package info (click to toggle)
tcng 10b-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,632 kB
  • ctags: 2,515
  • sloc: ansic: 19,038; pascal: 4,640; yacc: 2,619; sh: 1,908; perl: 1,546; lex: 772; makefile: 755
file content (42 lines) | stat: -rw-r--r-- 1,185 bytes parent folder | download | duplicates (5)
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
# variable names may contain underscores --------------------------------------
echo '$v_v = 5' | tcsim 2>&1
# variable names must not contain plus signs
echo '$v+v = 5' | tcsim 2>&1
ERROR
<stdin>:1: syntax error near "$v"
# simple command variable -----------------------------------------------------
tcsim
dev eth0 10000 

command $c = send 0x88 x 4

command $c
send 0x66 x 4
command $c
EOF
0.000000 E : 0x00000000 4 : eth0: 88888888
0.000000 D : 0x00000000 4 : eth0: 88888888
0.000000 E : 0x00000001 4 : eth0: 66666666
0.000000 E : 0x00000002 4 : eth0: 88888888
# command variable with "every" -----------------------------------------------
tcsim
dev eth0 10000

command $c = send 0x77 x 4

every 1s command $c
time 1.5s
command $c
time 2.5s
end
EOF
0.000000 E : 0x00000000 4 : eth0: 77777777
0.000000 D : 0x00000000 4 : eth0: 77777777
1.000000 E : 0x00000001 4 : eth0: 77777777
1.000000 D : 0x00000001 4 : eth0: 77777777
1.500000 E : 0x00000002 4 : eth0: 77777777
1.500000 D : 0x00000002 4 : eth0: 77777777
2.000000 E : 0x00000003 4 : eth0: 77777777
2.000000 D : 0x00000003 4 : eth0: 77777777
3.000000 E : 0x00000004 4 : eth0: 77777777
3.000000 D : 0x00000004 4 : eth0: 77777777