tst.aggpackbanner.ksh revision 33093f5bcdc51014933497dd39374080c1ac5705
199767f8919635c4928607450d9e0abb932109ceToomas Soome# This file and its contents are supplied under the terms of the
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# You may only use this file in accordance with the terms of version
199767f8919635c4928607450d9e0abb932109ceToomas Soome# 1.0 of the CDDL.
199767f8919635c4928607450d9e0abb932109ceToomas Soome# A full copy of the text of the CDDL should have accompanied this
199767f8919635c4928607450d9e0abb932109ceToomas Soome# source. A copy of the CDDL is also available via the Internet at
199767f8919635c4928607450d9e0abb932109ceToomas Soome# Copyright (c) 2013 Joyent, Inc. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome banner $3 | /bin/nawk -v line=$1 -v pos=$2 -v width=$width '{ \
199767f8919635c4928607450d9e0abb932109ceToomas Soome for (i = 1; i <= length($0); i++) { \
199767f8919635c4928607450d9e0abb932109ceToomas Soome if (substr($0, i, 1) == " ") \
199767f8919635c4928607450d9e0abb932109ceToomas Soome printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
199767f8919635c4928607450d9e0abb932109ceToomas Soome line, NR, i + (pos * width));
199767f8919635c4928607450d9e0abb932109ceToomas Soome printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
199767f8919635c4928607450d9e0abb932109ceToomas Soome for (i = 1; i <= length($0); i++) { \
199767f8919635c4928607450d9e0abb932109ceToomas Soome c = substr($0, i, 1); \
199767f8919635c4928607450d9e0abb932109ceToomas Soome printf("%s\n", c == " " ? "space" : \
199767f8919635c4928607450d9e0abb932109ceToomas Soome c == "\n" ? "newline" : c); \
199767f8919635c4928607450d9e0abb932109ceToomas Soome while [[ $i -le $line ]]; do