xref: /illumos-gate/usr/src/test/util-tests/tests/awk/gnu/printf1.awk (revision 5328fc53d11d7151861fa272e4fb0248b8f0e145)
1# Tue May 25 16:36:16 IDT 1999
2#
3# Test cases based on email from Andreas Schwab, schwab@gnu.org
4
5BEGIN {
6	fmt[1] = "%8.5d";	data[1] = 100
7	fmt[2] = "%#o";		data[2] = 0
8	fmt[3] = "%#.1o";	data[3] = 0
9	fmt[4] = "%#.0o";	data[4] = 0
10	fmt[5] = "%#x";		data[5] = 0
11	fmt[6] = "%.0d";	data[6] = 0
12	fmt[7] = "%5.0d";	data[7] = 0
13
14	for (i = 1; i <= 7; i++) {
15		format = "%s, %d --- |" fmt[i] "|\n"
16		printf(format, fmt[i], data[i], data[i])
17	}
18
19}
20