xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/leaddig.sh (revision 78801af7286cd73dbc996d470f789e75993cf15d)
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