[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: idl process id




korpela@islay.ssl.berkeley.edu (Eric J. Korpela) writes:

> 
> In article <6hgr8e$qs3$1@nnrp1.dejanews.com>,  <csaute3@alumni.umbc.edu> wrote:
> >I don't want to do "ps | grep idl" because of the result.
> >
> >IDL> spawn,'ps | grep idl',result,/sh
> >IDL> print, result
> >23847 pd S     0:02 /usr/local/rsi/idl_4/bin/bin.sunos.4.1/idl
> > 23852 pd S     0:00 sh -c ps | grep idl 23853 pd S     0:00 grep idl
> 
> Try this:
> 
> IDL> spawn,'ps | grep idl | grep -v grep',result,/sh
> IDL> print,result
> 23847 pd S     0:02 /usr/local/rsi/idl_4/bin/bin.sunos.4.1/idl
> IDL> print,long(result)
>        23847
> 
> If you really feel lucky you can try something like......
> 
> IDL> ; check your libc version before doing this!
> IDL> result=call_external('/lib/libc.so.1.9','getpid')
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^  ; Great stuff!
> IDL> print,result
>        23847
> 

  Eric, this is truly amazing. One of the best tips I've seen! Thanks!

I don't speak for JPL, it doesn't speak for me. 
Well, not all the time, at least. 
William Daffer <vapuser@haifung.jpl.nasa.gov>