delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/05/07/04:46:57

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:content-type:content-transfer-encoding
:subject:date:message-id:to:mime-version; q=dns; s=default; b=qS
Fp9GycItEbB6Mc/MWiOLHsP31vpEuMzqds5+nZx+sQ+wlbagR7pQfiNGT3SgEyvb
SqiAssqk3obuY0aTyAvKZkMknGCjXajBlFKuWZeypkyYANvvE8iPr4fH7ESNJOPN
26O/WEQlJ5oKoV8ra/pPEqzZ+MVzohykFNaOXXExw=
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:content-type:content-transfer-encoding
:subject:date:message-id:to:mime-version; s=default; bh=T4jvelyh
gf0ge4z+JDgpJHGFbdo=; b=OR2twfL7570dAlxRX8AG23wBy0aI9zYibC4hX9Ei
uH7HR/zDJ9EQICez8iCBy1Umrkzzy5eZKRc+OeLufVUifcqV3rnk48631OBuz0NG
E6uIJGMO15uQ+7jEiuQV9tZ2vUeyCF+H2p4HJxTZyodayF0gvHbbHj9m8ZP7Au4r
n98=
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
X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS autolearn=ham version=3.3.1
X-Received: by 10.194.133.166 with SMTP id pd6mr1624596wjb.19.1367916387920; Tue, 07 May 2013 01:46:27 -0700 (PDT)
From: AZ 9901 <az9901 AT gmail DOT com>
Subject: ps with command line arguments
Date: Tue, 7 May 2013 10:46:25 +0200
Message-Id: <ADAB05FC-DE25-4BEC-9362-081C5046E57A@gmail.com>
To: cygwin AT cygwin DOT com
Mime-Version: 1.0 (Apple Message framework v1283)
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r478kqHQ001947

Hello,

I run a bash script in a multi-user environment.
This script uses "ps -ef" in particular to list all its instances.

On a common UNIX / Linux system, it gives something like this :
bobby     20326 20318  0 10:21 ?        00:00:00 /bin/bash ./myscript.sh
marty     20330 20342  0 10:23 ?        00:00:00 /bin/bash ./myscript.sh
dudul     20339 20363  0 10:25 ?        00:00:00 /bin/bash ./myscript.sh
Perfect !

With Cygwin, "ps -ef" does not give command line arguments, so the script can't list its instances.
I was thinking about using procps or printing /proc/*/cmdline.
However, some of the users do not have admin rights, so they are not allowed to access /proc/<pid>/cmdline, /proc/<pid>/stat etc... of other users...

This is why "ps -ef" giving command line arguments would be really perfect !

But perhaps there is another solution ?

Could you help me ?

Thank you very much,

Best regards,

Ben


--
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