View Single Post
Old 06-21-2013, 05:11 AM   #14
SBT
Fanatic
SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.SBT ought to be getting tired of karma fortunes by now.
 
SBT's Avatar
 
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
Ah, the delights of non-standard standards...
Apparently, OSX sed, unlike GNU sed, does not interpret ';' as a newline.
To get it to work, either
Code:
sed -n -e '${' -e 's/.* //' -e p -e '}'
or
Code:
sed -n '${
s/.* //
p
}'
may work. However, your original solution for these lines now definitely
win out in terms of elegance.
Oh well, I've demonstrated there's more than one way to do it, at any rate. And you can do some mighty cool stuff with multi-line sed...
SBT is offline   Reply With Quote