#!/usr/local/rexx/rxx /* * BACKSPACE * * A filter program to remove embedded backspaces and the characters * that preceed them from a file. * * Execute the program by typing * * backspace * * where is the name of the file containing the embedded * characters and is one of the uni-REXX TRACE * options (all, error, etc.) * * The results of running the BACKSPACE program are directed to * standard output (the terminal screen) unless redirected elsewhere. * * For example, if you redirected the output of a "man" page to * a file named "output", you may see embedded backspaces in the * file when you edit it. To remove these characters for better * readability, you would run the backspace program. * * backspace output * * The may be omitted. If you choose to use the * option, you may enter the following * * backspace output i * * The 'i' turns intermediate tracing on. */ parse arg f t trace value t do while lines(f)>0 l = linein(f) do forever i = index(l,x2c('08')) /* find a backspace character */ if i>0 then do h = left(l,i-2) /* take out the backspace */ t = substr(l,i+1) /* and the character that */ l = h||t /* immediately preceeded it */ end else leave /* if no more backspaces, done with this line */ end call lineout , l end call lineout /* close the output file */