xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/compare.sh (revision ed093b41a93e8563e6e1e5dae0768dda2a7bcc27)
1#!/bin/bash
2
3if [[ -z "$AWK" ]]; then
4    printf '$AWK must be set\n' >&2
5    exit 1
6fi
7
8$AWK 'BEGIN {
9	if (ARGV[1]) print 1
10	ARGV[1] = ""
11	if (ARGV[2]) print 2
12	ARGV[2] = ""
13	if ("0") print "zero"
14	if ("") print "null"
15	if (0) print 0
16}
17{
18	if ($0) print $0
19	if ($1) print $1
20}' 0 1 compare.in
21