> From: Matthias Apitz <g...@unixarea.de>
>
> El dia Thursday, February 02, 2012 a las 01:51:56AM -0600, Robert Bonomi 
> escribio:
>
> Thanks, but the attached script (based on your content and saved to a
> script file) just gives:

*sigh*  the code worked wih gnu sed.

BSD sed is a whole lot more finicky with regard to whitespace.  And, it 
appears that  I've got some bug reports to file. 

Anyway, this is tested on FBSD 7.2:
copy _exactly_, making sure there is no trailing white-space on any line.
Then substitute an actual formfeed char for the {CTL-L}.
FreeBSD sed does not recognize either '\n' or '\f' in the substitution
string -- it strips the '\' and outputs the printable character.  *sigh* 

#!/bin/sh

sed  -e '
:l
/^[*][*]*$/ N
/\n..*$/ P
/\n..*$/ {
s/^.*\n//
b l
}
/\n$/ N
/\n\n[^*][^*]*$/ {
P
s/^.*\n// 
P
s/^.*\n//
b l
}
/\n\n[*]*$/ s/\n\n/\
{CTL-L}/'

_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to