bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gawk] Compatible way to test if a variable is set


From: Peng Yu
Subject: [bug-gawk] Compatible way to test if a variable is set
Date: Sun, 25 Nov 2018 11:52:03 -0600

Hi,

I can use SYMTAB to test if a variable has been set or not. But this
may not work in other variants of awk (e.g., mawk does not have
SYMTAB)

awk -e 'BEGIN { print("foo" in SYMTAB); print "NR" in SYMTAB }'

Is there a way to test if a variable is set that may be used across
gawk and other variants (such as mawk)?

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]