sed ': s/[1-9]/&s/g y/123456789/012345678/ s/s0/9s/ t s/0*/0/ s/\(s*\) 0*\1/ / /s /s/^/-/ / s/s/^/+/ s/ // :1 s/s/<<123456789s01>/ s/\(.\)<.*\1\(s*.\).*>/\2/ t1'