#!/usr/bin/sed -f ## (c) Carlos Duarte ## Created: 05-Sep-96 ## Updated: 29-Sep-96 ## # reverse all chars of each line, keep line ordering # 1. reject all empty lines, and all 1 chars only lines # 2. place two markers, `\n' at beggining and end of line # 3. swap first char after first marker with first before marker # 4. goto 4 until there are at least those two chars # # -- `\n' is a good marker, because, by default, `\n' isn't ever seen /../!b s/.*/\ &\ / ta :a s/\(\n.\)\(.*\)\(.\n\)/\3\2\1/ ta s/\n//g