Use sed instead of tail

tail -r was not a universal command