#!/bin/sh exec sed -ne ' h s/.*// G s/\(\n\)\(.*\)/\2\1/ :1 s/^\(.\)\(.*\)\(\n\)\(.*\)/\2\3\1\4/ t 1 s/\n// p ' ${1+"$@"} #eof