I am trying to execute a simple grep command in my shell script.
I am not sure why it also greps the other file system.

> df -g|grep /oracle/BP1/sapdata1
70.00 11.37 84% 21 1% /oracle/BP1/sapdata1
100.00 89.44 11% 8 1% /oracle/BP1/sapdata10
> df -g|grep /oracle/BP1/sapdata10
100.00 89.44 11% 8 1% /oracle/BP1/sapdata10

Does anyone know a work around?
Any help would be appreciated.

Thanks.
Shawn

Edited 6 Years Ago by shawnk: n/a

grep by itself just matches strings. It doesn't care what comes before or after.

Try something like df -g | egrep '/oracle/BP1/sapdata1$' That is, the line ends with sapdata1, not just contains sapdata1 (like sapdata10 contains sapdata1)

Edited 6 Years Ago by Salem: n/a

grep by itself just matches strings. It doesn't care what comes before or after.

Try something like df -g | egrep '/oracle/BP1/sapdata1$' That is, the line ends with sapdata1, not just contains sapdata1 (like sapdata10 contains sapdata1)

YES!!!
that worked. You are the man...

thanks.

This question has already been answered. Start a new discussion instead.