I need get a part of string depending on some value from a long string (for example some output from ps -ef).

for example source string:

```
long_string1="cmd ... -aaaa=A -bbbb=B -zzzz=Z -DHOME=/home/user/xxx -cccc=C ... etc."

```

or 

```
long_string2="cmd ... -aaaa=A -DHOME=/home/user/xxx -bbbb=B -zzzz=Z -cccc=C ... etc."

```

I want extract or get following subtring only after **-DHOME=** :

```
/home/user/xxx

```

Position of "**-DHOME=**" is not fixed, it could be anywhere in long\_string.

I am using following command:

```
echo $long_string1|sed -e 's/.*-DHOME=//g;s/ -cccc=C.*//g'

```

it works fine for $long\_string1 but it doesn't work for $long\_string2.

It will work only when "**-cccc=C**" will be netx to "**-DHOME=**" :-(

How can I get path after "**-DHOME=**" but not depend on next values e.g. "**-cccc=C**" ???

Is there any more effective way or regexp to get same output ?

Thanks
M.Gi