function to get the last output of a command that uses run() #104