unable to grep the running processes.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting unable to grep the running processes.
# 1  
Old 05-22-2012
unable to grep the running processes.

Hi All,

We have a shell script(ODS_Load)which loads the data from perticular flat file to oracle table invoking sqlplus based on the parameter.

When we execute the script(ODS_Load) independently, script is working fine and able to load the tables successfully.

We invoke(ODS_Load) with parameter from another script(Wrapper_ODS_Load), which checks if there are any ODS_Load happening for perticular feed if not then it invokes the ODS_load script. If the ODS_Load is happening then it does not again invoke ODS_Load.
Code:
#!/bin/bash
 
CONFLICT=`pgrep -f "ODS_Load $1"`
[ ! "$CONFLICT" ] && ODS_Load $1 &

But the pgrep -f "ODS_Load $1" is not returning any result even though the script ODS_Load is running. Can someone help us debug this issue?

Thanks and Regards
Nagaraja Akkivalli

Last edited by Franklin52; 05-22-2012 at 04:48 AM.. Reason: Please use code tags for code and data samples
# 2  
Old 05-22-2012
maybe ODS_Load closes the while assign to CONFLICT val
can u try this.
Code:
[ ! `pgrep -f "ODS_Load $1"` ] && ODS_Load $1 &

This User Gave Thanks to ygemici For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Linux

Running processes

Hi guys is it normal to have 5-10 cron/syslog processes running... in my case i got 10 cron process running. (4 Replies)
Discussion started by: batas
4 Replies

2. Solaris

Running processes on GZ/LZ

Hi guys just a question is it normal to see running process on a non-global zone in the global zone... processes such as cron. (3 Replies)
Discussion started by: batas
3 Replies

3. Shell Programming and Scripting

how to know the running processes.

Hi can anybody help me regarding this.. i want know the output of ps -ef with explanation. how can we know the running processess. this is the output of ps -elf F S UID PID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME CMD 19 T root 0 0 0 0 SY ... (1 Reply)
Discussion started by: rajesh_pola
1 Replies

4. UNIX for Dummies Questions & Answers

Is there a way to Grep processes running on Windows Servers...

Hi guys - newbie question: Is there a way for me to grep running processes from a windows machine? If its possible I could then try to script it. Currently I can see Windows file shares on my Linux server. (4 Replies)
Discussion started by: DallasT
4 Replies

5. Shell Programming and Scripting

Help in running two processes in parellel

I have a script something like this: #!/usr/bin/ksh CLASSPATH=/apps/opt/db2udb/admin/db2bdt/sqllib/java/db2java.zip:/apps/opt/db2udb/admin/db2bdt/sqllib/java/db2jcc.jar:/apps/opt/db2udb/admin/db2bdt/sqllib/function:$CLASSPATH export CLASSPATH ... (7 Replies)
Discussion started by: ss3944
7 Replies

6. UNIX for Dummies Questions & Answers

identifying running processes

how to identify the processes running by giving the parent process id (1 Reply)
Discussion started by: trichyselva
1 Replies

7. HP-UX

Unable to kill processes on HPUX

HPUX version B.11.23 as reported by uname -a Start with default signal I believe is -15 #kill PID Process still present. #kill -9 PID Process still present, even after repeated attempt and waiting. PPID becomes 1 which is the init process started at boot time. So far only way to... (8 Replies)
Discussion started by: matthewdesimone
8 Replies

8. UNIX for Advanced & Expert Users

running processes with no hang up

Can we run a script in nohup which calls another script in nohup. eg Script1.sh #Script1 start nohup script2.sh . . . #end script1.sh Now can I do this nohup script1.sh Also is all scheduled processes (crontab entries) will run as nohup? Would appreciate if any one can... (3 Replies)
Discussion started by: yakyaj
3 Replies

9. UNIX for Dummies Questions & Answers

how to find all processes that are running

Hi i've been googling a lot but can't find an answer. All I would like to know is how to find out all processes that are running on a machine. I know ps gives all YOUR processes. thanks (9 Replies)
Discussion started by: speedieB
9 Replies

10. Shell Programming and Scripting

Running two processes in background

hi there, here's what i need in my korn-shell: ... begin korn-shell script ... nohup process_A.ksh ; nohup process_B.ksh & ... "other stuff" ... end lorn-shell script in plain english i want process A and process B to run in the background so that the script can continue doing... (6 Replies)
Discussion started by: jacob_gs
6 Replies
Login or Register to Ask a Question