crappy bash implementation
getting field lengths