05-02-2007
Thanks for the response Shell Life.....
The line above the ps -f -p$item|cut -f5 -d" " includes the $item variable which does have a value....Here is the output when the script is run.....
# ./tunnel_ppid.sh ora_mmon_olap
checking for ora_mmon_olap session
ora_mmon_olap session found
Looking for parent pid - 6008
ppid_file.lst
ps: option requires an argument -- p
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]
ppid_file.lst
9 More Discussions You Might Find Interesting
1. Programming
question: for the below program
i just printed the value for pid, child pid and parent pid
why does it give me 6 values? i assume ppid is 28086
but can't figure out why there are 5 values printed instead of just two!
can someone comment on that!
#include<stdio.h>
#define DIM 8
int... (3 Replies)
Discussion started by: a25khan
3 Replies
2. UNIX for Dummies Questions & Answers
1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection?
2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies
3. Shell Programming and Scripting
Hello everyone , I am looking for a better solution then the one I have created for the my Task
The task is:
Create an automated script that will check for Uploads in a specified Directory and move them to another specified Directory if the files are completely uploaded.
Files are FTP'd to... (2 Replies)
Discussion started by: robertmcol
2 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this.
Thanks in advance,
Amudha (7 Replies)
Discussion started by: samudha
7 Replies
5. Shell Programming and Scripting
Hi guys!
I have a directory in the production environment from which i have to delete files older then 40 minutes with .pid extention. I wrote a script below for the purpose.
#!/bin/bash
#
# Script to delete specific file older than N minutes.
# OLDERTHAN="40" #40 minutes
... (6 Replies)
Discussion started by: sajid.shah
6 Replies
6. Shell Programming and Scripting
I'm trying to run the script below recursively but it is generating multiple and simultaneous processes. how do I do to start same script again (last line of my script) only after he had just run entirely?
The file name is bachup.sh
I am using this command:
# / bin / bash /
... (8 Replies)
Discussion started by: sprool
8 Replies
7. Shell Programming and Scripting
Hello
i have a requirement where in a file i will get string. The length could be from 1 to 20. if the string is less than 6 characters ( ex: ABCD) . i need to append 'X' on right hand side to make it 6 characters (ex: ABCDXX). if suppose i get the same string from the file as ABCDXX then i... (5 Replies)
Discussion started by: dsdev_123
5 Replies
8. Shell Programming and Scripting
I have a batch of mkv video files I would like to transcode to a more compressed format. After spending a significant amount of time experimenting with various parameters I think I have found the handbrake settings that give the best compromise. I now want to construct a simple bash script... (4 Replies)
Discussion started by: jonesal2
4 Replies
9. Shell Programming and Scripting
Hello. I am trying to create a script that recursively looks at my folder structure, and extracts any .7z files that have not already been extracted yet. I know that all .7z files only have a single .txt file in them, and the only .txt file in any directory would be from that .7z file.
I am... (3 Replies)
Discussion started by: Davinator
3 Replies
LEARN ABOUT OPENDARWIN
getsid
GETSID(2) BSD System Calls Manual GETSID(2)
NAME
getsid -- get process session
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <unistd.h>
pid_t
getsid(pid_t pid);
DESCRIPTION
The session ID of the process identified by pid is returned by getsid(). If pid is zero, getsid() returns the session ID of the current
process.
RETURN VALUES
Upon successful completion, the function getsid() returns the session ID of the specified process; otherwise, it returns a value of -1 and
sets errno to indicate an error.
ERRORS
getsid() will succeed unless:
[ESRCH] if there is no process with a process ID equal to pid.
Note that an implementation may restrict this function call to processes within the same session ID as the calling process.
SEE ALSO
getpgid(2), getpgrp(2), setpgid(2), setsid(2), termios(4)
HISTORY
The getsid() function call appeared in FreeBSD 3.0. The getsid() function call is derived from its usage in AT&T System V UNIX.
BSD
August 19, 1997 BSD