diff options
author | eteo <eteo> | 2006-04-23 03:28:45 +0000 |
---|---|---|
committer | eteo <eteo> | 2006-04-23 03:28:45 +0000 |
commit | 83a89572bebe11ba5d11db01b1ded66560a4b8f7 (patch) | |
tree | 88c5c04ab4056adc8987330c08a0fbf86d07a0d2 /examples | |
parent | 79cd1b2795241e23c5950f6ec7a7fe666d25ad70 (diff) | |
download | systemtap-steved-83a89572bebe11ba5d11db01b1ded66560a4b8f7.tar.gz systemtap-steved-83a89572bebe11ba5d11db01b1ded66560a4b8f7.tar.xz systemtap-steved-83a89572bebe11ba5d11db01b1ded66560a4b8f7.zip |
2006-04-23 Eugene Teo <eteo@redhat.com>
* small_demos/ansi_colors.stp: Add an example of using octal
escape sequences to display all possible ansi colors.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/small_demos/ansi_colors.stp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/small_demos/ansi_colors.stp b/examples/small_demos/ansi_colors.stp new file mode 100755 index 00000000..0d9d7c47 --- /dev/null +++ b/examples/small_demos/ansi_colors.stp @@ -0,0 +1,21 @@ +#! /usr/bin/env stap + +probe begin { + printf("a \\ b |"); + for (c = 40; c < 48; c++) + printf(" %d ", c); + printf("\12"); + for (l = 0; l < 71; l++) + printf("-"); + printf("\12"); + + for (r = 30; r < 38; r++) + for (t = 0; t < 2; t++) { + printf("%d |", r); + for (c = 40; c < 48; c++) + printf("\033[%d;%d%s %s \033[0;0m", + r, c, !t ? "m" : ";1m", !t ? "Normal" : "Bold "); + printf("\12"); + } + exit(); +} |