public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* extraneous 'I' in ps output
@ 2003-02-04 15:36 J.D. Laub
  2003-02-04 16:02 ` Andrew M. Inggs
  2003-02-04 23:09 ` extraneous 'I' in ps output (RESOLUTION) J.D. Laub
  0 siblings, 2 replies; 6+ messages in thread
From: J.D. Laub @ 2003-02-04 15:36 UTC (permalink / raw)
  To: cygwin

Here's a simple test case that shows the behavior I'm seeing:
$ dummy=`ps > /tmp/foo`
$ cat /tmp/foo
      PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
I    1268       1    1268       1268  con 12917 07:42:04 /usr/bin/bash
     1388    1268    1268       1388  con 12917 07:42:19 /usr/bin/bash
     1408    1388    1408       1332  con 12917 07:42:20 /usr/bin/ps

Anytime ps is called from command substitution, an 'I' gets
prepended to the line for the top shell.

I'm running install 2.249.2.5 on windoze2k which in running under
vmware hosted by deadrat8.0.

Due dilligence: I tried a fresh install of all of cygwin; same
results.  Nothing jumping out from the FAQ.  A search of the mail
archives on "ps" returned 0 hits (?!). There's no manpage for ps.
The online user guide doesn't mention that the floating 'I' should
be there.  Google turned up nothing obvious. ps isn't in its own
package, and I can't find docs on where to look to find out in which
package it was delivered. procps looked promising, so I installed
source for it as well as gdb, make, and gcc, but the build fails
with 'TIOCGWINSZ undeclared'.  Any other suggestions are most
welcome; I tend to prefer helping myself in an effort to minimizing
list noise, but I've run out of ideas.
-- 
J.D. Laub (Laubster) |"Your leg's too long / Your skull's too strong /
cygwin@laubster.org  | Suppose your nose is wrong." - Renaldo & the Loaf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: extraneous 'I' in ps output
  2003-02-04 15:36 extraneous 'I' in ps output J.D. Laub
@ 2003-02-04 16:02 ` Andrew M. Inggs
  2003-02-04 16:47   ` Ronald Landheer-Cieslak
  2003-02-04 23:09 ` extraneous 'I' in ps output (RESOLUTION) J.D. Laub
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew M. Inggs @ 2003-02-04 16:02 UTC (permalink / raw)
  To: cygwin

"J.D. Laub" <cygwin@laubster.org> wrote in message
news:<20030204154222.GA3915@aberdeen.fpcc.net>...
> Here's a simple test case that shows the behavior I'm seeing:
> $ dummy=`ps > /tmp/foo`
> $ cat /tmp/foo
>       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
> I    1268       1    1268       1268  con 12917 07:42:04 /usr/bin/bash
>      1388    1268    1268       1388  con 12917 07:42:19 /usr/bin/bash
>      1408    1388    1408       1332  con 12917 07:42:20 /usr/bin/ps
>
> Anytime ps is called from command substitution, an 'I' gets
> prepended to the line for the top shell.
>
I see this too (cygwin-1.3.19-1).

> ps isn't in its own package, and I can't find docs on where to
> look to find out in which package it was delivered.

I can help you there, try <http://cygwin.com/packages/>.  It
helps to narrow things down if you give a bit more than just
the filename, e.g., usr/bin/ps (note: no leading / though).
From here you'll see ps is in the cygwin package.

-- Andrew




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: extraneous 'I' in ps output
  2003-02-04 16:02 ` Andrew M. Inggs
@ 2003-02-04 16:47   ` Ronald Landheer-Cieslak
  2003-02-04 16:55     ` Christopher Faylor
  0 siblings, 1 reply; 6+ messages in thread
From: Ronald Landheer-Cieslak @ 2003-02-04 16:47 UTC (permalink / raw)
  To: Andrew M. Inggs; +Cc: cygwin

Hello all,

AFAICT, the I stands for "idle" and this is correct output. In any case,
it is the process status (have a look at the source - it is in the cygwin
package, under the winsup/utils directory (ps.cc) The ps is not entirely
OpenUnix or POSIX compliant (but I'm sure the maintainer (cgf?) will
gratefully accept patches) but AFAICT this is expected behaviour.

If this is posing a problem for one of your scripts, you might want to 
consider making the script a bit sturdier :)

rlc

On Tue, 4 Feb 2003, Andrew M. Inggs wrote:
> "J.D. Laub" <cygwin@laubster.org> wrote in message
> news:<20030204154222.GA3915@aberdeen.fpcc.net>...
> > Here's a simple test case that shows the behavior I'm seeing:
> > $ dummy=`ps > /tmp/foo`
> > $ cat /tmp/foo
> >       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
> > I    1268       1    1268       1268  con 12917 07:42:04 /usr/bin/bash
> >      1388    1268    1268       1388  con 12917 07:42:19 /usr/bin/bash
> >      1408    1388    1408       1332  con 12917 07:42:20 /usr/bin/ps
> >
> > Anytime ps is called from command substitution, an 'I' gets
> > prepended to the line for the top shell.
> >
> I see this too (cygwin-1.3.19-1).
> 
> > ps isn't in its own package, and I can't find docs on where to
> > look to find out in which package it was delivered.
> 
> I can help you there, try <http://cygwin.com/packages/>.  It
> helps to narrow things down if you give a bit more than just
> the filename, e.g., usr/bin/ps (note: no leading / though).
> >From here you'll see ps is in the cygwin package.
> 
> -- Andrew
> 
> 
> 
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: extraneous 'I' in ps output
  2003-02-04 16:47   ` Ronald Landheer-Cieslak
@ 2003-02-04 16:55     ` Christopher Faylor
  2003-02-04 17:09       ` Ronald Landheer-Cieslak
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Faylor @ 2003-02-04 16:55 UTC (permalink / raw)
  To: cygwin

On Tue, Feb 04, 2003 at 05:54:37PM +0100, Ronald Landheer-Cieslak wrote:
>AFAICT, the I stands for "idle" and this is correct output.

The "I' stands for input and it is correct output.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: extraneous 'I' in ps output
  2003-02-04 16:55     ` Christopher Faylor
@ 2003-02-04 17:09       ` Ronald Landheer-Cieslak
  0 siblings, 0 replies; 6+ messages in thread
From: Ronald Landheer-Cieslak @ 2003-02-04 17:09 UTC (permalink / raw)
  To: cygwin

On Tue, 4 Feb 2003, Christopher Faylor wrote:
> On Tue, Feb 04, 2003 at 05:54:37PM +0100, Ronald Landheer-Cieslak wrote:
> >AFAICT, the I stands for "idle" and this is correct output.
> The "I' stands for input and it is correct output.
Ah, I should have looked at the source a bit closer :)

thx

rlc


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: extraneous 'I' in ps output (RESOLUTION)
  2003-02-04 15:36 extraneous 'I' in ps output J.D. Laub
  2003-02-04 16:02 ` Andrew M. Inggs
@ 2003-02-04 23:09 ` J.D. Laub
  1 sibling, 0 replies; 6+ messages in thread
From: J.D. Laub @ 2003-02-04 23:09 UTC (permalink / raw)
  To: cygwin

On Tue, Feb 04, 2003 at 08:42:22AM -0700, J.D. Laub wrote:
>       PID    PPID    PGID     WINPID  TTY  UID    STIME COMMAND
> I    1268       1    1268       1268  con 12917 07:42:04 /usr/bin/bash
> Anytime ps is called from command substitution, an 'I' gets
> prepended to the line for the top shell.

Thanks to Andrew for the pointer to the source, and to Ronald and
Christopher for their insight.

Inspection of the code shows ps is working as designed.  There's an
undocumented column in the default ps output which indicates status.
The column has no header, and it may not always be populated.  The
column can be suppressed by using either -f or the non-standard -s.

To find out what shell is currently running, I've changed my
.profile (which handles any of sh/zsh/bash/bash2/ksh on a half dozen
operating systems) from this:

    shell=`ps | awk "{if ($$ == \\$1) print \\$NF}" \
        | sed -e 's,.*/,,' -e 's,-,,'`

to this:

    shell=`ps | sed 's/^[^0-9 ]*//' \
        | awk "{if ($$ == \\$1) print \\$NF}" \
        | sed -e 's,.*/,,' -e 's,-,,'`
-- 
J.D. Laub (Laubster) |"Your leg's too long / Your skull's too strong /
cygwin@laubster.org  | Suppose your nose is wrong." - Renaldo & the Loaf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-02-04 23:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 15:36 extraneous 'I' in ps output J.D. Laub
2003-02-04 16:02 ` Andrew M. Inggs
2003-02-04 16:47   ` Ronald Landheer-Cieslak
2003-02-04 16:55     ` Christopher Faylor
2003-02-04 17:09       ` Ronald Landheer-Cieslak
2003-02-04 23:09 ` extraneous 'I' in ps output (RESOLUTION) J.D. Laub

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).