xref: /illumos-gate/usr/src/test/util-tests/tests/awk/examples/awk/t.split8 (revision 3ee4fc2aa6b5136515cc3eed32d3c6ef33e37471)
1*3ee4fc2aSCody Peter Mello{
2*3ee4fc2aSCody Peter Mello	n = split ($0, x, /[ 	]+/)
3*3ee4fc2aSCody Peter Mello	print n
4*3ee4fc2aSCody Peter Mello	if (n != NF)
5*3ee4fc2aSCody Peter Mello		print "split botch at ", NR, n, NF
6*3ee4fc2aSCody Peter Mello	for (i=1; i<=n; i++)
7*3ee4fc2aSCody Peter Mello		if ($i != x[i])
8*3ee4fc2aSCody Peter Mello			print "different element at ", i, x[i], $i
9*3ee4fc2aSCody Peter Mello}
10