how to get the result of a command