import shutil


def read_back(shared_dir, output_file):
    """
    Read text files back into an iterable from temp file then destroy the
    temp file and its parent directory.

    :param shared_dir: the temporary directory that the container mounted
    :param output_file: path to output filename
    :return: iterable of output file contents
    """

    with open(output_file, 'r', encoding='utf-8') as file_handle:
        output = [x.rstrip('\r\n') for x in file_handle.readlines()]
    shutil.rmtree(shared_dir)
    return output