From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <98443449610087.tru64-unix-managers.marc@archive.invalid> From: Oyanarte Portilho Date: Mon, 12 Mar 2001 22:00:04 +0000 To: tru64-unix-managers Subject: [Summary] script that gets PID X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=98443449610087 Hi Gurus, Many thanks to Mandell Degerness, Patrick Farley, alan@nabeth and Bill Melvin. 1) Mandell sent the following: renice +some_value `ps aux | grep | grep -v grep | awk '{print $2}'` which works fine. 2) Patrich sent: #!/bin/sh ps -eo pid,comm |grep |while read AA do echo $AA renice +some_value -p $AA done which also works though produces also a sintax error in renice because it takes the process name together with the PID. 3) Allan suggests: foreach i ( `ps ax | grep program | grep -v grep | awk '{ print $X }'` ) command to renice by pid end which I have not tested. Bill suggests me to read the manual of getpid(2), which should be useful in a c program. Regards, Oyanarte Portilho Institute of Physics University of Brasilia, Brazil ======================== original posting: > I wish to have a script that gets the PID of a running code and > renices it. Could you help me?