Trim alias and command strings