xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/leaddig.sh (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
1#!/bin/bash
2
3if [[ -z "$AWK" ]]; then
4    printf '$AWK must be set\n' >&2
5    exit 1
6fi
7
8# check that values with leading digits get converted the
9# right way, based on a note in comp.lang.awk.
10#
11# run with gawk -v x=2E -f leaddig.awk
12$AWK -v x=2E 'BEGIN {
13	print "x =", x, (x == 2), (x == 2E0), (x == 2E), (x == 2D)
14}'
15