display proces id (Re: to GNU ps or not to GNU ps)

2002-04-03 Thread Sven Guckes

* Shawn McMahon [EMAIL PROTECTED] [2002-04-03 13:56]:
 We ran into this problem when one of our developers wrote an
 application on Linux that did a ps and looked for a string, when
 the process in question was in an extremely long path and was run
 with the full path name.  When he ported it to Solaris, it wouldn't
 work, even with /usr/ucb/ps, because of the cutoff.  I suggested
 we install GNU ps, but nobody in management wanted to hear that.

well, as soon as the installation of some
little program makes the companie's own
programs stop working then it is time
to install something better, isn't it?

time to exchange[tm] the management!

ObMutt:
can mutt display its own process id?

the display of the porcess id would be
helpful when there's a problem with mutt.
the admin could add this number to the
status_format in /etc/Muttrc so that
users will see it and will catch it
with a screen hardcopy.  bug reports
might then be handled much quicker..

Sven  [should i have started a new thread?]



Re: display proces id (Re: to GNU ps or not to GNU ps)

2002-04-03 Thread Dave Pearson

* Sven Guckes [EMAIL PROTECTED] [2002-04-03 16:33:45 +0200]:

 can mutt display its own process id?

set status_format=Hello, I am mutt and my PID is `echo $PPID`

and variations on that theme?

-- 
Dave Pearson:  | mutt.octet.filter - autoview octet-streams
http://www.davep.org/  | mutt.vcard.filter - autoview simple vcards
Mutt:  | muttrc2html   - muttrc - HTML utility
http://www.davep.org/mutt/ | muttrc.sl - Jed muttrc mode



Re: display proces id (Re: to GNU ps or not to GNU ps)

2002-04-03 Thread darren chamberlain

* Sven Guckes [EMAIL PROTECTED] [2002-04-03 09:40]:
 ObMutt:
 can mutt display its own process id?
 
 the display of the porcess id would be
 helpful when there's a problem with mutt.
 the admin could add this number to the
 status_format in /etc/Muttrc so that
 users will see it and will catch it
 with a screen hardcopy.  bug reports
 might then be handled much quicker..

This made me interested.  This works for me, against mutt-1.3.27.
Ite defines %$ as the status char for the pid.  My rudimentary tests
show that it Does The Right Thing.

(I diff'ed with -caw; is there a preferred option set for mutt patches?)

(darren)

*** status.c.orig   Wed Apr  3 11:11:19 2002
--- status.cWed Apr  3 11:17:51 2002
***
*** 52,58 
   * %S = current aux sorting method ($sort_aux)
   * %t = # of tagged messages [option]
   * %v = Mutt version 
!  * %V = currently active limit pattern [option] */
  static const char *
  status_format_str (char *buf, size_t buflen, char op, const char *src,
   const char *prefix, const char *ifstring,
--- 52,59 
   * %S = current aux sorting method ($sort_aux)
   * %t = # of tagged messages [option]
   * %v = Mutt version 
!  * %V = currently active limit pattern [option]
!  * %$ = current pid */
  static const char *
  status_format_str (char *buf, size_t buflen, char op, const char *src,
   const char *prefix, const char *ifstring,
***
*** 272,277 
--- 273,283 
optional = 0;
break;
  
+ case '$':
+   snprintf (fmt, sizeof(fmt), %%%sd, prefix);
+   snprintf (buf, buflen, fmt, getpid());
+   break;
+ 
  case 0:
*buf = 0;
return (src);

-- 
Responsible behavior is the result of a socialization process.



Re: display proces id (Re: to GNU ps or not to GNU ps)

2002-04-03 Thread Jeremy Blosser

On Apr 03, darren chamberlain [[EMAIL PROTECTED]] wrote:
 (I diff'ed with -caw; is there a preferred option set for mutt patches?)

-dup



msg26625/pgp0.pgp
Description: PGP signature


Re: display proces id (Re: to GNU ps or not to GNU ps)

2002-04-03 Thread darren chamberlain

* Jeremy Blosser [EMAIL PROTECTED] [2002-04-03 16:19]:
 On Apr 03, darren chamberlain [[EMAIL PROTECTED]] wrote:
  (I diff'ed with -caw; is there a preferred option set for mutt patches?)
 
 -dup

Noted.

(darren)

-- 
The moment one gives close attention to anything, even a blade of
grass, it becomes a mysterious, awesome, indescribably magnificent
world in itself.
-- Henry Miller