File: print-flags.sh

package info (click to toggle)
tcpdump 4.3.0-1%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,400 kB
  • sloc: ansic: 66,862; sh: 3,185; makefile: 384; awk: 123; perl: 29
file content (29 lines) | stat: -rwxr-xr-x 689 bytes parent folder | download
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
#!/bin/sh

for i in x xx X XX A AA; do
	#
	# We cannot rely on, for example, "print-x.out" and
	# "print-X.out" being different files - we might be running
	# this on a case-insensitive file system, e.g. a Windows
	# file system or a case-insensitive HFS+ file system on
	# Mac OS X.
	#
	# Therefore, for "X" and "XX", we have "print-capX.out"
	# and "print-capXX.out".
	#
	if test $i = X
	then
		printname=capX
	elif test $i = XX
	then
		printname=capXX
	else
		printname=$i
	fi
	if (../tcpdump -$i -s0 -nr print-flags.pcap | tee NEW/print-$printname.new | diff - print-$printname.out >DIFF/print-$printname.out.diff )
	then
		echo print-$i passed.
	else
		echo print-$i failed.
	fi
done