sed -n -e '/somestring/h ; ${} x ; p }' should be sed -n -e '/somestring/h ; ${ x ; p }'
Created attachment 227681 [details, diff] proposed patch
Pushed. Thanks for the fix.