Sponsored Content
Top Forums Shell Programming and Scripting unable to grep the running processes. Post 302644501 by Nagaraja Akkiva on Tuesday 22nd of May 2012 03:22:06 AM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
service(8)						      System Manager's Manual							service(8)

NAME
service - run a System V init script SYNOPSIS
service SCRIPT COMMAND [OPTIONS] service --status-all service --help | -h | --version DESCRIPTION
service runs a System V init script in as predictable an environment as possible, removing most environment variables and with the current working directory set to /. The SCRIPT parameter specifies a System V init script, located in /etc/init.d/SCRIPT. The supported values of COMMAND depend on the invoked script. service passes COMMAND and OPTIONS to the init script unmodified. All scripts should support at least the start and stop commands. As a special case, if COMMAND is --full-restart, the script is run twice, first with the stop command, then with the start com- mand. service --status-all runs all init scripts, in alphabetical order, with the status command. EXIT CODES
service calls the init script and returns the status returned by it. FILES
/etc/init.d The directory containing System V init scripts. ENVIRONMENT
LANG, TERM The only environment variables passed to the init scripts. SEE ALSO
/etc/init.d/skeleton, update-rc.d(8), init(8), invoke-rc.d(8). Jan 2006 service(8)
All times are GMT -4. The time now is 04:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy