def echo(
    enode, string, trailing_newline=True, backslash_escape=False, shell=None
):
    """
    Echo an string.

    :param enode: Engine node to communicate with.
    :type enode: topology.platforms.base.BaseNode
    :param str string: String to be echoed.
    :param bool trailing_newline: Append a newline at the end of the output.
    :param bool backslash_escape: Enable interpretation of backslash-escaped
     strings.
    :rtype str:
    :return: The echoed output string.
    """

    command = 'echo '

    if not trailing_newline:
        command = '{command}-n '.format(command=command)

    if backslash_escape:
        command = '{command}-e '.format(command=command)

    command = '{command}"{string}"'.format(command=command, string=string)

    return enode(command, shell=shell)