remove \n from cmd string