def exec_script(scriptpath, stdout=None, stderr=None, mock=False):
    """ This function must return a command line executable as a string.

    Parameters
    ----------
        scriptpath: str
            Path to the script to be executed
        stdout: str
            Path to file to which stdout is to be piped
        stderr: str
            Path to file to which stderr is to be piped
        mock: Bool
            When called with mock=True, the command to be executed will be echoed
            to the stdout file.
    """
    if mock:
        return f'''echo "/bin/bash {scriptpath}" '''

    else:
        return f"/bin/bash {scriptpath}"