Sponsored Content
Top Forums Shell Programming and Scripting Why does the 'pid' keep changing every time? Post 302383637 by Scrutinizer on Wednesday 30th of December 2009 11:25:48 AM
Old 12-30-2009
I suspect that if you temporarily replace $2 by $0 you will find that the awk statement is in fact selecting its own pid.
Try putting square brackets around one of the characters of the process name you are looking for, e.g.:
Code:
ps -ef | awk '/[l]s/{ print $2 }'


Last edited by Scrutinizer; 12-30-2009 at 12:31 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to MV without changing Time Stamp

Hi, I need to move the set of files, and it should be same time stamp as previous. How to do this? (3 Replies)
Discussion started by: redlotus72
3 Replies

2. Shell Programming and Scripting

changing modified time

How to change the modified time of a file to any specified time. ls -ltr drwxr-xr-x 2 pipe pipe 4096 Jun 10 10:33 coredump_06062008 ---------------------------------------------------------------------- here file coredump_06062008 last modified time is Jun 10 10:33 and i... (1 Reply)
Discussion started by: ali560045
1 Replies

3. Shell Programming and Scripting

Changing the output in own time display's.

Hi all, I've written a script which collects some information and sendsout a mail.. (code pasted below) ssh -l ora${sid} ${primaryhost} "tail -50 /oracle/$ORACLE_SID/newbackup/END_BACKUP.log" |grep 'insert' |tail -1| awk '{print $7}' >> ${RESULTFILE} Output would look like this:... (1 Reply)
Discussion started by: suri.tyson
1 Replies

4. AIX

changing server time

Hi all, we have IBM- AIX 5.2 operating system on that we have our oracle production database and there is daily crontab script for backup. my boss told me to change the server time.if i change the server time by root user does it give problem to any application or script which are... (2 Replies)
Discussion started by: younusdba
2 Replies

5. HP-UX

Changing system time in HP-UX using perl

Hi All, I would like to change system time for my testing purposes. All I need is to change the system time forward/backward in seconds. I am providing the perl code that I am using to change system time on all platforms. --------- use strict; use English; my $sec; my $mday; my... (2 Replies)
Discussion started by: xyz3245
2 Replies

6. AIX

changing the time zone in aix

hi may aix version is 6100-06-03-1048 when i give date command it shows the time zone as root@cbspsgui01 #date Fri Sep 16 08:43:42 Africa/Johannesburg 2011 I want to change the time zone to GMT +02:00: After i change the time zone it should show something like the one below when i type... (2 Replies)
Discussion started by: newtoaixos
2 Replies

7. UNIX for Dummies Questions & Answers

Start Time and period of a PID

Hi, Below is my OS details. uname -an SunOS mymachine 5.10 Generic_144488-07 sun4v sparc SUNW,SPARC-Enterprise-T5220 I need to know when was my Apache server last started. Whats is the best and most reliable way to find out not just for Apache but for any PID per say? I am... (16 Replies)
Discussion started by: mohtashims
16 Replies

8. Shell Programming and Scripting

Changing time-stamp with sed

Hi ! I try to change a time-stamp hh:mm:ss allways to full ten-minutes. example: 12:51:03 to 12:50:03 sed 's/::/:{0-5}0:/g' file.txt but it will not work propperly, because the minute-decade will be replaced with the bracket-term {0-5}. Can someone please give me a hint? Thanks in... (6 Replies)
Discussion started by: IMPe
6 Replies

9. Red Hat

Touch - changing date and time

Hi, I am facing a problem with the command - TOUCH on Linux. See the example below: File on Linux: rw-rw-r-- user1 user1 Jan 01 09:00 test.txt The file - test.txt was created by the user - user1. Now, I want to change the date and time, but using other user - user2 The user2... (12 Replies)
Discussion started by: brjohnsmith
12 Replies

10. Shell Programming and Scripting

Kill nohup process with changing PID

Hi there! I have a tricky problem concerning a nohup process: I started a python2.7 script which loops over a function. At the end it restarts the function. Due to a mistake I'm now having a never ending nohup process that I have to kill. I started the program execution with: >>nohup... (4 Replies)
Discussion started by: Lydia
4 Replies
rad_detach_pid(3)					     Library Functions Manual						 rad_detach_pid(3)

NAME
rad_detach_pid - Detach a process from a Resource Affinity Domain by pid (libnuma library) SYNOPSIS
#include <numa.h> int rad_detach_pid( pid_t pid ); PARAMETERS
Specifies a process identifier (pid) to detach from a RAD set. DESCRIPTION
The rad_detach_pid() function frees a process that has been bound or attached to a RAD through the functions rad_bind_pid() or rad_attach_pid(), respectively. If the pid argument is NULL, the call is self-directed. That is, the function behaves as if the calling process's pid were specified. Calling rad_detach_pid() for a process that is not attached or bound is not considered to be an error. RETURN VALUES
Success. In this case, rad_detach_pid() detaches the pid specified by pid from the RAD set. Failure. In this case, errno is set to indi- cate the error. ERRORS
If the rad_detach_pid() function fails, errno is set to one of the following values for the reasons specified. The process specified in pid does not exist. The real or effective user ID of the caller does not match the real or effective user ID of the process pid, or the caller does not have appropriate privileges to free processes from RADs. SEE ALSO
Functions: rad_attach_pid(3), rad_bind_pid(3) rad_detach_pid(3)
All times are GMT -4. The time now is 03:39 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy