Same as appliedenergistics.sh except it doesn't need sed and I had to add -m 1 to grep.