Sponsored Content
Top Forums Shell Programming and Scripting need to check if the process is running Post 302548606 by Corona688 on Thursday 18th of August 2011 10:02:24 PM
Old 08-18-2011
awk doesn't know that anything's wrong, and you only get the return value of the last command.

It's traditional to have whatever runs a persistent program save its PID in a file, so you don't need to resort to ps | grep | awk | kitchen | sink tricks to find out what the PID is. This also allows systems where more than one instance of it can be run independently without interfering with each other.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to check if another instance of the process is running

Hi, I am writing a shell script to invoke a C++ program. Before I start the C++ program (oi7loadbalancer), I am checking if the process is already running. I start the process only if it is not already running. I have the following check in my script. proccount=`ps -f -u $USER_NAME | grep... (8 Replies)
Discussion started by: sim
8 Replies

2. Shell Programming and Scripting

check process running

I have this script: ------------------------------------------------------- #!/bin/ksh # if ] || ] then echo "Executing main_load.sh script" /usr1/psc_load/jobs/cron/main_load.sh "ods" else echo "File not found, do nothing" fi exit 0 ... (4 Replies)
Discussion started by: rose1207
4 Replies

3. UNIX for Advanced & Expert Users

how to check how long the process has been running.

I have a requirement to check how long a process is running on unix system.If i use ps -ef i am getting the following message guest 2453638 1998920 0 16:16:05 - 0:00 dsapi_slave 9 8 0 but this is showing only time not the date.Can any one please advice me any script to find out how... (2 Replies)
Discussion started by: ukatru
2 Replies

4. UNIX for Advanced & Expert Users

How to check since when (for how long) a particular process is running ?

How do I check if a particular process is running from a certain date and time ? (2 Replies)
Discussion started by: hpuxlxboy
2 Replies

5. Shell Programming and Scripting

Check if Process is running

Hi , I have a csh code below which check the process if it's running. Can any expert advise me on the following: 1) what does this notationmean ">!" and how is it different from the append ">" notation ? 2) how does "setenv" work in this code ? # Check whether there is a running... (3 Replies)
Discussion started by: Raynon
3 Replies

6. UNIX and Linux Applications

How to check if process is running?

Hi I would like to check if an instance of a script is already running. I've seen many different examples, but I haven't the slightest idea as to how to do this. Can you please help. Thank you. (5 Replies)
Discussion started by: ladyAnne
5 Replies

7. UNIX for Dummies Questions & Answers

Command to check if a particular process is running

Hi What is the best command to check if a particular process is running in a linux server or not To check any java process, I use the below command. ps -ef |grep jvm When I execute the above command, it lists me all the processess . The above command should ideally return only the... (6 Replies)
Discussion started by: vr3w3c9
6 Replies

8. Programming

How do I check if a process is running in C

How to I check if a process is running in C? I'm trying to use ps aux |grep "process name" but failing in doing that. How do I do that? Thanks, (1 Reply)
Discussion started by: cprogdude
1 Replies

9. UNIX for Dummies Questions & Answers

How a process can check if a particular process is running on different machine?

I have process1 running on one machine and generating some log file. Now another process which can be launched on any machine wants to know if process1 is running or not and also in case it is running it wants to stream the logs file generated by process1 on terminal from which process2 is... (2 Replies)
Discussion started by: saurabhnsit2001
2 Replies

10. Shell Programming and Scripting

Looping to check the currently running process.

Hi Gurus, t=`ps -u irb|grep -v grep|grep BSNL_PAYMENT_C` echo $t if then echo $? echo "Process Creation is Running ...." else echo "Process went down at $dat $tim" fi How would i use loop so that the script continously checks for the current status of this process.... (1 Reply)
Discussion started by: ankitknit
1 Replies
QUICKPLOT_SHELL(1)					      General Commands Manual						QUICKPLOT_SHELL(1)

NAME
quickplot_shell - a remote command line shell for quickplot SYNOPSIS
Usage: quickplot_shell [PID]|[-h|--help]|[QUICKPLOT_OPTIONS] DESCRIPTION
Quickplot is an interactive 2D plotter. It's primary focus is to interactively display 2D plots. quickplot_shell connects to a running Quickplot program. quickplot_shell provides a command line interface for most of the graphical user interfaces that are in the Quickplot program. quickplot_shell reads and writes to standard input and standard output respectively. When standard input is a tty device quick- plot_shell enables readline tab completion and history. If you would like to save your Quickplot shell history between sessions just cre- ate a .quickplot_history in your home directory with a command like `touch ~/.quickplot_history'. If the argument option PID is not given, quickplot_shell will launch Quickplot as a new process and connect to that new process. In this case Quickplot will be started with QUICKPLOT_OPTIONS if any are given. If PID is given, quickplot_shell will connect to a running Quickplot program with process ID PID. quickplot_shell sets up two named pipes, signals the running Quickplot program and writes commands and reads responses to and from the pipe. The named pipes will be unlinked as soon as they are connected, and hence will be removed automatically when the two programs are no longer running. quickplot_shell, the remote Quickplot shell, acts just like running quickplot --shell, a local Quickplot shell, but quickplot_shell runs as a separate process and talks to the Quickplot program using pipes, where as quickplot --shell runs one process with both the GUI and the shell with no pipes. You may connect as number of remote Quickplot shells to a Quickplot program. -h, --help display help and exit SEE ALSO
quickplot(1) COPYRIGHT
Copyright (C) 1998-2011 Lance Arsenault Quickplot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Quickplot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Quickplot. If not, see <http://www.gnu.org/licenses/>. AUTHOR
Lance Arsenault <lanceman@users.sourceforge.net> Send bug reports or comments to the above address. For more information, see the Quickplot homepage at <http://quickplot.sourceforge.net/>. Quickplot Version 0.10.3: 31 Jan 2012 03:27:29 UTC QUICKPLOT_SHELL(1)
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy