Sponsored Content
Top Forums Shell Programming and Scripting finding Background Process Id Post 302142161 by krk_555 on Wednesday 24th of October 2007 06:09:23 PM
Old 10-24-2007
Hi,
can u send any sample code.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

capture the process id when starting a background process

Hello all, How do I start a background process and save the process id to a file on my system. For example %wait 5 & will execute and print the process id. I can't figure out how to get it to a file. I've tried: > filename 0>filename 1>filename. Any assistance is most appreciated. Thanks, Jim... (10 Replies)
Discussion started by: jleavitt
10 Replies

2. Programming

background process

I have made a shell that accept a command and parameters. It is working properly. I have tryed to implement background process in main(). But i dont know to implement them. Can anyone give me a lille example?? #include <stdlib.h> #include <stdio.h> #include <string.h> /* The following... (3 Replies)
Discussion started by: badshah
3 Replies

3. Shell Programming and Scripting

process in background

Hi Guys, I am facing some weird problem with my shell script. The script shows up a menu and for every ontion internally calls a shell script which start/stop various servers. When I am using '&' while calling the internal shell script so that the server run in the background. For exiting... (1 Reply)
Discussion started by: agoyal
1 Replies

4. Shell Programming and Scripting

background process

Hi, In shell script when I use script1 >> filelog the echo statments of script1 gets printed in the filelog but when I try to run script in background i.e, script1 & >> filelog nothing gets printed in the filelog. Anybody knows whats going on here. thanks (3 Replies)
Discussion started by: k_oops9
3 Replies

5. UNIX for Dummies Questions & Answers

background process

How, can I hide background process's output? (5 Replies)
Discussion started by: zylwyz
5 Replies

6. Shell Programming and Scripting

background process

can anybody plz tell me how can i find the background processes running. (2 Replies)
Discussion started by: Raom
2 Replies

7. Shell Programming and Scripting

Background Process.

How to create a backgrond processes ? (5 Replies)
Discussion started by: anupdas
5 Replies

8. UNIX for Dummies Questions & Answers

Script to start background process and then kill process

What I need to learn is how to use a script that launches background processes, and then kills those processes as needed. The script successfully launches the script. But how do I check to see if the job exists before I kill it? I know my problem is mostly failure to understand parameter... (4 Replies)
Discussion started by: holocene
4 Replies

9. Shell Programming and Scripting

How to put FTP process as a background process/job in perl?

Hi, I am using net::ftp for transferring files now i am trying in the same Linux server as a result ftp is very fast but if the server is other location (remote) then the file transferred will be time consuming. So i want try putting FTP part as a background process. I am unaware how to do... (5 Replies)
Discussion started by: vanitham
5 Replies

10. Shell Programming and Scripting

Make background process interact with fg process

Hi, I have written a menu driven shell script in which as per the choice, I run the another script on background. For eg: 1. get info 2)process info 3)modify info All the operations have different scripts which i schedule in background using &. However I wish to display the error... (0 Replies)
Discussion started by: ashima jain
0 Replies
getpid(2)							System Calls Manual							 getpid(2)

NAME
getpid(), getpgid(), getpgrp(), getpgrp2(), getppid() - get process, process group and parent process ID. SYNOPSIS
DESCRIPTION
These functions return process, process group and parent process IDs, as follows: Process group ID of the specified process. If pid is zero, the call applies to the calling process. Same result as Process group ID of the calling process. Process group ID of the specified process. If pid is zero, the call applies to the calling process. Same result as Process ID of the calling process. Parent process ID of the calling process. If the parent process is the initialization process (known as the call returns 1. Security Restrictions The system call is subject to compartmental restrictions. See compartments(5) for more information about compartmentalization on systems that support that feature. Compartmental restrictions can be overridden if the process possesses the privilege (PRIV_COMMALLOWED). Processes owned by the superuser may not have this privilege. Processes owned by any user may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUE
The functions return the following values: Successful completion. n is a nonnegative process ID, as described above. Failure: and only. is set to indicate the error. ERRORS
If or fails, is set to one of the following values: [EPERM] The current process and pid are not in the same session (see setsid(2)). [ESRCH] No process can be found corresponding to that specified by pid. AUTHOR
and were developed by HP, AT&T, and the University of California, Berkeley. SEE ALSO
exec(2), fork(2), setpgid(2), setsid(2), signal(5). STANDARDS CONFORMANCE
getpid(2)
All times are GMT -4. The time now is 12:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy