xref: /illumos-gate/usr/src/test/util-tests/tests/awk/bugs-fixed/space.awk (revision 3ee4fc2aa6b5136515cc3eed32d3c6ef33e37471)
1*3ee4fc2aSCody Peter MelloBEGIN {
2*3ee4fc2aSCody Peter Mello	c[" "] = "\" \""
3*3ee4fc2aSCody Peter Mello	c["\a"] = "\\a"
4*3ee4fc2aSCody Peter Mello	c["\b"] = "\\b"
5*3ee4fc2aSCody Peter Mello	c["\f"] = "\\f"
6*3ee4fc2aSCody Peter Mello	c["\n"] = "\\n"
7*3ee4fc2aSCody Peter Mello	c["\r"] = "\\r"
8*3ee4fc2aSCody Peter Mello	c["\t"] = "\\t"
9*3ee4fc2aSCody Peter Mello	c["\v"] = "\\v"
10*3ee4fc2aSCody Peter Mello
11*3ee4fc2aSCody Peter Mello	sort = "LC_ALL=C sort"
12*3ee4fc2aSCody Peter Mello
13*3ee4fc2aSCody Peter Mello	for (i in c)
14*3ee4fc2aSCody Peter Mello		printf("%s %s [[:space:]]\n", c[i],
15*3ee4fc2aSCody Peter Mello			i ~ /[[:space:]]/ ? "~" : "!~") | sort
16*3ee4fc2aSCody Peter Mello
17*3ee4fc2aSCody Peter Mello	for (i in c)
18*3ee4fc2aSCody Peter Mello		printf("%s %s [[:blank:]]\n", c[i],
19*3ee4fc2aSCody Peter Mello			i ~ /[[:blank:]]/ ? "~" : "!~") | sort
20*3ee4fc2aSCody Peter Mello
21*3ee4fc2aSCody Peter Mello	close(sort)
22*3ee4fc2aSCody Peter Mello}
23