get process id

John Esak john at valar.com
Sun Oct 10 10:59:24 PDT 2004


Scott,

This is not awfully elegant, but you could certainly do just drop out to the
shell with a system call, grep for something unique in the clerk command
line, grab the thrid field of the line that _isn't_ the grep line.... I
would write this in a second for you if you really need it... but if I do
the syntax for "cut" without looking it up, I am SURE to get it wrong and
everyone would yell at me. I do remember that "cut" does work from
zero-relative, so it might be the 2nd item in the line you are grepping
for... (see why I don't want to write this _very_ simple line?? :-)  But, I
think it would certainly get you the exact PID of the running clerk.

By the way, if is something that can be tested for "after-the-fact".  You
could also do the old trick of testing $?   could this be what you are
looking for?

[ $? != 0 ] && do_this_test_was_true || do_this_test_was_false   (or make
the test a positive one and reverse the executions accordingly.)


Either way this lets you see if the last process succeeded or failed (in a
gross kind of "I finished at least") executing.  I use it like this... it
might do what you want, if you dump the 2 channel into something like
/tmp/error as well?  I realize this isn't what you asked for... just trying
to be helpful.


ddir npio -L -m nexwest
dreport npio -f mvclosed -v mvclosedv -a -u -m nexwest
[ $? != 0 ] && exit
ddir npio -L
ddir npio -L -m nexwest
/usr/local/bin/fpkd -C npio nexwest

John Esak






> -----Original Message-----
> From: filepro-list-bounces at lists.celestial.com
> [mailto:filepro-list-bounces at lists.celestial.com]On Behalf Of Kenneth
> Brody
> Sent: Sunday, October 10, 2004 11:04 AM
> To: Scott Nelson
> Cc: FilePro Mailing List
> Subject: Re: get process id
>
>
> Scott Nelson wrote:
> >
> > Having a brain clog here.
> >
> > SCO OpenServer 5.06, fP 5
> >
> > I need to get the process id of a filepro program and use it in
> a variable
> > while in the program.  I know this has been discussed in the past, but
> > there is a memory leak here....
>
> Must it really be the PID of the filePro program, or just a unique
> number?  (ie: would the PID of a child process called via USER be
> sufficient?)
>
> --
> +-------------------------+--------------------+------------------
> -----------+
> | Kenneth J. Brody        | www.hvcomputer.com |
>            |
> | kenbrody/at\spamcop.net | www.fptech.com     | #include
> <std_disclaimer.h> |
> +-------------------------+--------------------+------------------
> -----------+
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list



More information about the Filepro-list mailing list