<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def eval_file(file):
    'evaluate file content as expressions'

    fname = os.path.realpath(os.path.expanduser(file))
    with open(fname) as f:
        inscript = f.read()

    sh = run_write_read(['plash', 'eval'], inscript.encode()).decode()

    # we remove an possibly existing newline
    # because else this macros would add one
    if sh.endswith('\n'):
        return sh[:-1]

    return sh