def sed(path,
        before,
        after,
        limit='',
        backup='.bak',
        options='-r -e',
        flags='g',
        escape_all=False,
        negate_match=False):
    # Largely inspired by Fabric's contrib.files.sed()
    # XXX:dc: Do we really want to always force escaping?
    #
    path = os.path.expanduser(path)

    if not os.path.exists(path):
        return False

    # Mandate that before and after are strings
    before = str(before)
    after = str(after)
    before = _sed_esc(before, escape_all)
    after = _sed_esc(after, escape_all)
    limit = _sed_esc(limit, escape_all)
    if sys.platform == 'darwin':
        options = options.replace('-r', '-E')

    cmd = ['sed']
    cmd.append('-i{0}'.format(backup) if backup else '-i')
    cmd.extend(salt.utils.shlex_split(options))
    cmd.append(
        r'{limit}{negate_match}s/{before}/{after}/{flags}'.format(
            limit='/{0}/ '.format(limit) if limit else '',
            negate_match='!' if negate_match else '',
            before=before,
            after=after,
            flags=flags
        )
    )
    cmd.append(path)

    return __salt__['cmd.run_all'](cmd, python_shell=False)
.. deprecated:: 0.17.0
dataset/ETHPy150Open saltstack/salt/salt/modules/file.py/sed