Store the command result for complex state machines.

    It is useful when exact command output is embedded in another commands, i.e. admin show inventory in eXR.

def a_store_cmd_result(ctx):
    """Store the command result for complex state machines.

    It is useful when exact command output is embedded in another commands, i.e. admin show inventory in eXR.
    """
    result = ctx.ctrl.before
    # check if multi line
    index = result.find('\n')
    if index > 0:
        # remove first line
        result = result[index + 1:]
    ctx.device.last_command_result = result.replace('\r', '')
    return True