Subjectively

dd if=/dev/random | kirk > blog

Subjectively header image 4

Entries from February 25th, 2009

sed script to trim leading and trailing spaces

February 25th, 2009 · No Comments · Linux, OS X

i couldn’t find this anywhere, so just to make it generally public, this is my trim function: sed ‘s/^[[:space:]]*\(.*\)[[:space:]]*$/\1/’ For who’s looking, this command says: from beginning of line ^ take any amount of whitespace [[:space:]] then create a group containing anything \(.*\) up to whitespace at the end of the line [[:space:]]*$ replace this [...]

[Read more →]

Tags: