Next: , Previous: Extension Sample Readdir, Up: Extension Samples


16.7.7 Reversing Output

The revoutput extension adds a simple output wrapper that reverses the characters in each output line. It's main purpose is to show how to write an output wrapper, although it may be mildly amusing for the unwary. Here is an example:

     @load "revoutput"
     
     BEGIN {
         REVOUT = 1
         print "hello, world" > "/dev/stdout"
     }

The output from this program is: ‘dlrow ,olleh’.