'Extract env_var and path values from sh derivative shells.
Iterates over each line, word by word searching for statements that set the
path. These are either variables, or conditions that would allow a variable
to be set later in the line (e.g. export).
Args:
lines: A list of lines, each of which is a list of space separated words.
Returns:
a dictionary of path names and values.'

def _ParseShVariables(self, lines):

    paths = {}
    for line in lines:
        for entry in line:
            if ('=' in entry):
                (target, vals) = (entry.split('=', 1) + [''])[:2]
                if vals:
                    path_vals = vals.split(':')
                else:
                    path_vals = []
                self._ExpandPath(target, path_vals, paths)
            elif (entry not in self._SH_CONTINUATION):
                break
    return paths
