cd and pwd, fixed: when commands end with spaces or tabs