Tuesday, June 26, 2012

Recent nice sed commands

Here are two nice sed calls that I did today:

To delete 6 lines out of every file that has a particular line in it:

grep -n "The number of passes was" | xargs -L1 -t sed -i -e '/The number of passes was/,+6d'

To delete all lines containing a match out of every file:

grep -n "$start_" | xargs -L1 -t sed -i -e '/\$start_/,+1d'

the -t in xargs is just to echo which files were altered to the screen, the -i in sed is modify in place (very handy), the +1 before the d in the second command was probably unneccesary.

Sunday, June 3, 2012

Refridgerator Filter

For our Whirlpool refrigerator, model # ED2KHAXVQ01, the replacement filter seems to be PUR 4396841, which at the moment we can still buy at Lowes. It's the two-port, "Fast Fill" type. The box additionally says "Replacement cartridge #P2RFWG2 for Filter Model # P2WG2L, P1WG2L, P2WG2 and P1WG2". The filter can be ordered online at www.whirlpool.com/accessories, no doubt if you can navigate a nighmarish selection maze of course.