How to create a dummy process of a process already running?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users How to create a dummy process of a process already running?
# 1  
Old 08-31-2007
How to create a dummy process of a process already running?

Hi Everybody,

I want to create a shell script named as say "jip" and it is runned.
And i want that when i do ps + grep for the process than this jip should be shown as process.

Infact there might be process with name jip which is already running.
# 2  
Old 08-31-2007
ps -ef |grep jip>/dev/null /* finds if there is one whith no verbose */
if [ $? -ne 0 ] /* if there is not executes jip */
then
jip
fi

Last edited by fazliturk; 08-31-2007 at 03:30 AM..
# 3  
Old 08-31-2007
Quote:
Originally Posted by fazliturk
ps -ef |grep jip>/dev/null /* finds if there is one whith no verbose */
if [ $? -ne 0 ] /* if there is not executes jip */
then
jip
fi
Infact i didn't get you.
My concern is to create a simple shell script name say "jip".
Ofcourse there are other jip process which are running in the background.which are generally stopped by another shell script (say stop.sh).

My concern is to check for multiple jip process which are left running even after "stop.sh" is executed.
So i want to change the stop.sh but inorder to visualize whether the modification is working fine or not, i have to check it .And this can be achieved if only there are multiple jip process.

So i want to create a shell script which when runned should be viewed in the ps + grep of jip.

But i am not been able to do it.

I have created a file with the name jip.sh, where an infinite loop is running, but then also it is not viewed when i do grep for the "jip" process.

Can u please help me out from this. ?
# 4  
Old 08-31-2007
As much as I understood .You want to see your background process named something with ps ;

ps -ef |grep processname gives this.

there is no need to infinite loop. just;

echo "input someting : \n "
read input1
echo $input1

untill you input anything process waits.when you enter finishes.while waiting input you can check the process in on other screen. and you can start multiple processes.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Command to get exact tomcat process I am running ignoring other java process

Team, I have multiple batchjobs running in VM, if I do ps -ef |grep java or tomcat I am getting multiple process list. How do I get my exact tomcat process running and that is unique? via shell script? (4 Replies)
Discussion started by: Ghanshyam Ratho
4 Replies

2. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (6 Replies)
Discussion started by: naveeng
6 Replies

3. UNIX for Advanced & Expert Users

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (1 Reply)
Discussion started by: naveeng
1 Replies

4. BSD

Process remians in Running state causing other similar process to sleep and results to system hang

Hi Experts, I am facing one problem here which is one process always stuck in running state which causes the other similar process to sleep state . This causes my system in hanged state. On doing cat /proc/<pid>wchan showing the "__init_begin" in the output. Can you please help me here... (0 Replies)
Discussion started by: naveeng
0 Replies

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

6. UNIX for Dummies Questions & Answers

Running different process from current process?

I have been having some trouble trying to get some code working, so I was wondering...what system calls are required to execute a different program from an already running process? (1 Reply)
Discussion started by: Midwest Product
1 Replies

7. Shell Programming and Scripting

Create a html file if a process is running??

Hi All, I need to check for a process, if the process is running then I have to create an HTML file, say A.HTML. If the process is not running then I have to rename the existing html, say A.HTML to B.HTML so that the process which looks for the file A.HTML does not find it? How do I do... (1 Reply)
Discussion started by: Hangman2
1 Replies

8. Shell Programming and Scripting

script to monitor process running on server and posting a mail if any process is dead

Hello all, I would be happy if any one could help me with a shell script that would determine all the processes running on a Unix server and post a mail if any of the process is not running or aborted. Thanks in advance Regards, pradeep kulkarni. :mad: (13 Replies)
Discussion started by: pradeepmacha
13 Replies

9. UNIX for Dummies Questions & Answers

dummy question on data process

I have a file which contains 6 columns. But I only need the first 3 columns. So I need to remove the last 3 columns. I checked 'cut' but it seems not working. So is there a command that could remove certain columns from a file? :( Thanks a lot!! (5 Replies)
Discussion started by: kaixinsjtu
5 Replies

10. Programming

How to create constantly running process

Ther are two process in my program and i want both to constantly running. So i have written the following code. But one of this process which is calling function wsJobCheck() is getting terminated with giving message : Program exited normally. Can any one suggest why this is happing. Code : ... (1 Reply)
Discussion started by: bhakti
1 Replies
Login or Register to Ask a Question