#!/bin/rc for(i) { echo ',s/^$/ /g ,s/[^ ]$/& /g w q' | ed $i >/dev/null }