This is a script for adding rests to empty lines. Example input and output is below. (c)2003 David Raleigh Arnold -- under GNU. It can serve as an example of how to use the filters in ptfilter.sed to run on a block of text in xemacs, for example. Free for all. Enjoy! #1/bin/bash # pie -- Put In Empty line. # Syntax: pie file (redirect output) # Put @pie=Xxx in line by itself # or at end of a line to keep it. # Xxx (s1?, r2.?) will be written to all lines # without text which follow until # @pie=somethingElse. # First "s/tab/space/g" needs a tab. That line # is already in ptfilter.sed sed 's/ / /g /^ *@pie/{ s/@pie=\([^ ]*\)/\1/ h p d } /@pie=/{ s/@pie/% @pie/g p s/.*@pie=\([^ ]*\)/\1/ h d } /^ *$/{ s/ *//g g } ' $1 ---------end bash script input: a2 g4 f % @pie=s2 r4 s c2 d e4 f g f e4 d d d @pie=r2 s2 e2 c \laminate gub @pie=sky ww @pie=% --------------output: a2 g4 f % % @pie=s2 r4 s c2 d e4 f g f s2 r4 s e4 d d d r2 s2 e2 c r2 s2 \laminate gub % @pie=sky ww sky %