Extract a part of grep output

Hi,
On AIX 7
I have :

grep 's_ohs_instance_loc' $CONTEXT_FILE
        
<ohs_instance_loc oa_var="s_ohs_instance_loc">/u01/appl_top/env/fs1/FMW_Home/webtier/instances/EBS_web_env_OHS1</ohs_instance_loc>

But I need only this part: /u01/appl_top/env/fs1/FMW_Home/webtier/instances/EBS_web_env_OHS1

which is between > and < How can I have it?

Thanks

Hi, try;

awk '/s_ohs_instance_loc/{print $2}' RS=\< FS=\> "$CONTEXT_FILE"

Here is one as well.

awk '/s_ohs_instance_loc/ && match($0,/>.*</) { print substr($0,RSTART+1,RLENGTH-2) } '

Regards
Peasant.

Thanks to all.

One thing to note is that this will work as long as there are no other tags on the line where the match occurs..