improved shell string lexer