How do I get a particular string?


I have the following lines in a file. I want to have the value followed by the string "/status=" to be stored into an shell variable (say $stat). What is the best way to do it?

in my case, $stat should have the value "OPEN".

following is the content of the file:

Oracle Server Manager Release - Production

Copyright (c) 1997, 1999, Oracle Corporation. All Rights Reserved.

Oracle8i Release - Production
JServer Release - Production

SVRMGR> SVRMGR> Connected.
1 row selected.
SVRMGR> SVRMGR> Server Manager complete.

export stat=`grep "/status" file | cut -d'=' -f2`

Thank you very much for the response