Hi,
x=GATE
ps -ef|grep pmon
grid 552 1 0 Aug08 ? 00:00:51 asm_pmon_+ASM1
oracle 4314 1 0 Aug08 ? 00:04:08 ora_pmon_GATE1
oracle 5018 1351 0 10:14 pts/1 00:00:00 grep pmon
oracle 7329 1 0 Aug08 ? 00:02:19 ora_pmon_NRID1
ps -ef|grep pmon |grep $x
oracle 4314 1 0 Aug08 ? 00:04:08 ora_pmon_GATE1
but i want the result if it contains only GATE but not the GATE1
-Thanks,
try using grep $x$ if you are expecting GATE at the end of line..
1 Like
methyl
3
Belt and braces:
ps -fuoracle | grep -v "grep" | grep "pmon" | grep "GATE" | grep-v "GATE1"
It would be better as:
ps -fuoracle | grep -v "grep" | grep "ora_pmon_GATE" | grep -v "ora_pmon_GATE1"
Maybe consider changing the name of each listener?
bakunin
4
I suggest you consult the man page of "grep", especially the meaning of the "-w" switch (word boundaries).
I hope this helps.
bakunin