Waits for cmd status before output status