1. If you want to use the + to indicate one-or-more, it must be escaped. Check out this lovely example:
lark [1045] head -n 1 1028/1028-10.txt | sed "s/[ ]+/\n/g" | wc -l
1
lark [1046] head -n 1 1028/1028-10.txt | sed "s/[ ]\+/\n/g" | wc -l
976
Ahhhh what a difference one little backslash can make.
2. \s does NOT mean white space. Doh.
All that ranting about sed reminded me that I had written another nerdy limerick and not posted it, so here it is:
Limerick #3
if you work in Euclidean spaces
and you want an orthogonal basis
you can see what you get
from using Gram-Schmitt
but it might not be nice in all cases
0 comments:
Post a Comment