dtrace: Address KMSAN warnings in dtrace_disx86
[freebsd/src.git] / usr.bin / lastcomm / tests / legacy_test.sh
blobd890db590e14622c8a757f3bd7ea2b2c2e8052e7
1 #!/bin/sh
5 DIR=`dirname $0`
6 ARCH=`uname -m`
8 TZ=UTC; export TZ
10 check()
12 NUM=$1
13 shift
14 # Remove tty field, which varies between systems.
15 awk '{$4 = ""; print}' |
16 if diff -a - $1 >&2
17 then
18 echo "ok $NUM"
19 else
20 echo "not ok $NUM"
25 cat $DIR/v1-$ARCH-acct.in $DIR/v2-$ARCH-acct.in >v1v2-$ARCH-acct.in
26 cat $DIR/v2-$ARCH.out $DIR/v1-$ARCH.out >v1v2-$ARCH.out
28 echo 1..6
30 lastcomm -cesuS -f $DIR/v1-$ARCH-acct.in | check 1 $DIR/v1-$ARCH.out
31 lastcomm -cesuS -f - <$DIR/v1-$ARCH-acct.in | tail -r | check 2 $DIR/v1-$ARCH.out
32 lastcomm -cesuS -f $DIR/v2-$ARCH-acct.in | check 3 $DIR/v2-$ARCH.out
33 lastcomm -cesuS -f - <$DIR/v2-$ARCH-acct.in | tail -r | check 4 $DIR/v2-$ARCH.out
34 lastcomm -cesuS -f v1v2-$ARCH-acct.in | check 5 v1v2-$ARCH.out
35 lastcomm -cesuS -f - <v1v2-$ARCH-acct.in | tail -r | check 6 v1v2-$ARCH.out
37 exit 0