2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright (c) 2013 Joyent, Inc. All rights reserved.
20 banner $3 |
/bin
/nawk
-v line
=$1 -v pos
=$2 -v width
=$width '{ \
21 for (i = 1; i <= length($0); i++) { \
22 if (substr($0, i, 1) == " ") \
24 printf("\t@letter%d[%d] = lquantize(%d, 0, 40, 1);\n", \
25 line, NR, i + (pos * width));
35 printf "#pragma D option aggpack\n#pragma D option aggsortkey\n"
38 for c
in `echo "$1" | /bin/nawk '{ \
39 for (i = 1; i <= length($0); i++) { \
40 c = substr($0, i, 1); \
41 printf("%s\n", c == " " ? "space" : \
42 c == "\n" ? "newline" : c); \
45 if [[ "$c" == "space" ]]; then
51 outputchar
$line $pos $c
57 while [[ $i -le $line ]]; do
58 printf "\tprinta(@letter%d);\n" $i
61 printf "\texit(0);\n}\n"
64 dtrace
-qs /dev
/stdin
-x encoding
=utf8
<<EOF
65 `outputstr "why must i do this"`
68 dtrace
-qs /dev
/stdin
-x encoding
=ascii
-x aggzoom
<<EOF
69 `outputstr "i am not well"`
72 dtrace
-qs /dev
/stdin
-x encoding
=utf8
-x aggzoom
<<EOF
73 `outputstr "send help"`