delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/03/26/06:59:35

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; q=dns; s=default; b=wg4
Il300DRAw8bhV79QeaUCnRqaxfzfBrxj9SkJ14tYed/O3SACpizri9Gsrib3wav7
0sZ9f5uPECQ4A//98LegVE2ZPeF/68XKHgRAQUiepDAvPu+DExmJlzoFmr8X8u4W
j4V2sC7mY6H4IZTqfhrP9y8QCuIbg/gUqF4ygtd4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:from:to:subject:date:message-id:content-type
:content-transfer-encoding:mime-version; s=default; bh=IQaYpl552
3Dsh9oaBVV1shq7Nss=; b=NbKiLCyvQid/ZSpI0a7BABqueUSULKjaRS6fwrzbG
iZp+dTwCddNFW6knAq9ybhz+FYzEotS0obBAWAOnb/fdQWCz+5DZUMxO3rQyEAQ6
/NLnugGDJ3ri2FmR3dyT9LvNfrlHfJVmUiUZZEW3YZZQ6BV8nf8brStexKS0LHyW
Ko=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=ham version=3.3.2
X-HELO: mail02.mylogin24.com
From: Holger Dietze <holger DOT dietze AT inforsacom DOT com>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Question about the ps command, missing option -o to format the output
Date: Wed, 26 Mar 2014 10:59:04 +0000
Message-ID: <DDE9CDBA2B37C246B69D8E4C96647D3D01AC9C05C9@DEFFMMBX102.elabs.int>
x-exclaimer-md-config: bafe0317-1695-46a2-95c8-237e0dbb2839
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id s2QAxQEJ025248

Hello,

I am writing some scripts for linux and cygwin. To find out, if
a given pid (from /var/run/<pidfile> is really the pid of the
correct process I use the ps command on linux (and AIX, Solaris,
even HPUX with a trick) with the option -o pid=

Example:

# ps -ef | grep bash
root      1118  1112  0 11:55 pts/4    00:00:00 -bash
root      1195  1118  0 11:55 pts/4    00:00:00 grep bash
root     21885 21883  0 10:44 pts/3    00:00:00 -bash
root     31068 31065  0 Feb07 pts/1    00:00:00 bash

# ps -p 31068 -o pid= -o comm= 
31068 bash

Trying same command on cygwin:

Administrator AT server ~
$ ps -ef | grep bash
Administ    6456    4184 pty1     11:56:59 /usr/bin/bash

Administrator AT server ~
$ ps -p 6456
      PID    PPID    PGID     WINPID   TTY     UID    STIME COMMAND
     6456    4184    6456       7016  pty1     500 11:56:59 /usr/bin/bash

Administrator AT server ~
$ ps -p 6456 -o pid=
ps: unknown option -- o
Try `ps --help' for more information.

Administrator AT server ~
$


I have searched the man page and the Cygwin projects, but did not found a way to get
this working.

Is this a feature request?

Thanx, Holger


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019