NetBSD/gnu/dist/gawk/test/printf1.awk
wiz 06c09073b3 Initial import of gawk-3.1.3.
Seven releases since the last import, so the ChangeLog is quite big;
please refer to the NEWS file included in the import for details.
Among others, this also addresses PR 23054.
2003-10-06 15:55:26 +00:00

20 lines
439 B
Awk

# Tue May 25 16:36:16 IDT 1999
#
# Test cases based on email from Andreas Schwab, schwab@gnu.org
BEGIN {
fmt[1] = "%8.5d"; data[1] = 100
fmt[2] = "%#o"; data[2] = 0
fmt[3] = "%#.1o"; data[3] = 0
fmt[4] = "%#.0o"; data[4] = 0
fmt[5] = "%#x"; data[5] = 0
fmt[6] = "%.0d"; data[6] = 0
fmt[7] = "%5.0d"; data[7] = 0
for (i = 1; i <= 7; i++) {
format = "%s, %d --- |" fmt[i] "|\n"
printf(format, fmt[i], data[i], data[i])
}
}