implement text length on linux