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