Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Check the process before run or not Post 302118611 by mr_bold on Wednesday 23rd of May 2007 06:25:32 AM
Old 05-23-2007
Thank you for all, this script works.

Code:
#!/bin/sh

if [ "$(ps -ef | grep "FileCollector.jar -id7" | wc -l)" -gt 1 ]; then
    # process is running
    echo "process is running"
else
    # process is not running
    echo "process is not running"
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How can I run a process under particular ID?

I have a script that needs to run under ID say "xyz". the way I do normally is to "su" to the id, enter the password of "xyz" and run the process. However, is there any way run the process under "xyz" without "su" to the ID. A person with root access would be able to run any process under any ID as... (4 Replies)
Discussion started by: ucbus
4 Replies

2. Shell Programming and Scripting

Run a process but on a certain pid

Hi all, I am having a little bit of trouble trying to find something out. I am trying to script a start/stop php file, for some gaming servers i host. The server have 2 lots of processes running on them, and the customers need to be able to start and stop them at their will. So i know how to... (1 Reply)
Discussion started by: Syth
1 Replies

3. UNIX for Dummies Questions & Answers

Run a detached process

Hey guys, Just wondering is there anyway that I would be able to run a detached process that would continue to run regardless of me being logged into the linux host? (4 Replies)
Discussion started by: killaram
4 Replies

4. Shell Programming and Scripting

script to monitor the process system when a process from user takes longer than 15 min run.

get email notification from from system when a process from XXXX user takes longer than 15 min run.Let me know the time estimation for the same. hi ,any one please tell me , how to write a script to get email notification from system when a process from as mentioned above a xxxx user takes... (1 Reply)
Discussion started by: kirankrishna3
1 Replies

5. Shell Programming and Scripting

How to run a particular process

Hi I have a perl script where i created 3 nmap scans and the results will output to a text file. But when i run the code the first ip address gets scanned then the others after, but i want to be able to choose which ip address to scan. Here is my code: (`nmap -v -r 99.xxx.xxx -p... (0 Replies)
Discussion started by: kingbp
0 Replies

6. UNIX for Dummies Questions & Answers

Can you check when a file was last run?

Hi, I was wondering if there was any way in unix to check when a file was last run. I'm doing a basic menu. 1. Savefile 2. Check when SaveFile was last run. What can I use here to display when SaveFile was last run? Coding so far is if then echo Save file was last used: ... (2 Replies)
Discussion started by: Purepatch
2 Replies

7. Shell Programming and Scripting

How to run Background process one after another

Hii Friends, I am using Perl CGI. I am running A SCP Command via Perl CGI in Background. Like system("scp -r machinename:/PathOfFile/ /Path/WhereToCopyIt/ &) This Copy Process takes some times lets say 15 min. Now I want When This copy process gets complete then send me... (5 Replies)
Discussion started by: Navrattan Bansa
5 Replies

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

9. UNIX for Beginners Questions & Answers

How to check who run the command?

Dear Team, i need to know in linux if someone run the command in linux server where i can check on server . i need to know the below points who (user) when (date and time) what (command) regards, scriptors (1 Reply)
Discussion started by: scriptor
1 Replies

10. UNIX for Beginners Questions & Answers

How to detect which process is run by what?

Hello, I am running under ubuntu 14.04 Very long time ago, I set a script (ban.sh) to block ip addresses abusing my system which was not active. I have not touched the server over six months or more. Today, after restart the system, ban.sh started running all of a sudden and keep submitting... (4 Replies)
Discussion started by: baris35
4 Replies
win(1)							      General Commands Manual							    win(1)

NAME
win - Terminal emulator SYNOPSIS
win [-v] [-t name] [command [argument ...]] address OPTIONS
-v If the -v option is present, win prints its version number and date and exits. -tname If the -t option is present, win uses +name as the final part of the tag name of its window. DESCRIPTION
win must be able to connect to a running wily(1). win attaches to a window. If the -t option is present, the final part of the tag name is name. If command is present, the final part of the tag name is +command. Otherwise, the final part of the tag name is +win. The first part of the tag name is the current working directory. win runs a program in a child process. The child process is the leader of a process group and is connected to win by a pseudo-terminal. If command is specified, the child process runs $SHELL -c 'command argument ...' otherwise it runs $SHELL -i If SHELL is not found in the environment, /bin/sh is used. TERM=win is placed in the environment of the running program. Output from the running command appears in the window. The point after the last output from the running command is known as the output point. Further output from the running command appears just before the output point. The output point is initially at the end of the win- dow. Normal wily editing commands work in the window. When a newline, interrupt character, or end-of-file character is created after the output point, the text between the output point and the last newline, interrupt character, or end-of-file character in the window (inclusive) is passed to the running program as input. The interrupt character is control-C and the end-of-file character is control-D. The pseudo-terminal initially is configured so that these are recognized with their normal meanings. The B2 commands beginning with the |, <, or > characters or an upper case letter are executed normally by wily. Other B2 are first termi- nated with a newline, if they are not already, and are then appended to the buffer (and thereafter passed to the running program). RETURNS
win returns zero if it is able to successfully create the child process, otherwise it returns non-zero. EXAMPLES
Run a terminal emulator within wily win Run FTP within wily win ftp Run rlogin within wily win -t host.domain rlogin -8 host.domain SEE ALSO
wily(1) Tag(1) Man(1) BUGS
win doesn't follow changes to the terminal attributes. In particular, there is no way to stop echoing or to change its concept of the interrupt and eof characters. rlogin seems to need -8 and, annoyingly, sets echo and onlcr. The latter can be fixed in your .rcrc: if ( ~ $TERM win ) { stty -echo -onlcr } win doesn't follow changes to the terminal attributes. In particular, there is no way to stop echoing or to change its concept of the interrupt and eof characters. WEdestroy messages aren't yet passed by wily. Thus, Del and Delcol can delete the window yet leave win running. There is a race condition; the user can press newline and then delete text before win has a chance to read it. AUTHOR
win was originally written by Gary Capell (gary@cs.su.oz.au). Alan Watson (alan@oldp.nmsu.edu) rewrote it and added support for arguments, pseudo-terminals instead of pipes, and execution of certain B2 commands by wily. The pseudo-terminal support in 9term, written by Matty Farrow (matty@cs.su.oz.au), was a great help. 1R1.1L1 of 1D1 win(1)
All times are GMT -4. The time now is 12:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy