delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2024/04/22/04:47:50

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E9315384514B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1713775669;
bh=+M5/P2NFvrcufm3v3H5nuayXjSljBFK3DT3G3O8ofzI=;
h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=QHMXJYDgSnLfRWUtp1u24bMO5PDGbARswFowBD+yJbxW/fjNrJS5r6aCtUoBbQMOk
3GHxWXOD/NjZud3sNOmhotGaqhWdz3fF8rehgEHuExJ7+Dq5QDnKYy3azZKZ2thobR
RqMMcEdPPlPFP7BFHTAgLRKID56woaZ7DHX69wMY=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3A3A3858D38
Date: Mon, 22 Apr 2024 10:46:48 +0200
To: cygwin AT cygwin DOT com
Subject: Re: /usr/bin/sg in Cygwin?
Message-ID: <ZiYj-L-RmT9ezjwg@calimero.vinschen.de>
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CAAvCNcBw0z3EJnjvs4hooW7cmgRvCA=-ofMywYZM3+f9OcJEFQ AT mail DOT gmail DOT com>
<CAAvCNcDch6VYDYR3ocwUdko8m0CUtMCM-OLRqmDDn-8hCQYySg AT mail DOT gmail DOT com>
<b7ee5e6a-f351-4293-861a-9c4b59ef69dd AT SystematicSW DOT ab DOT ca>
<CAAvCNcB_vuStJjnd+GohVM-y=AHZBUP=Gi5A+AAgnddP3wDdQQ AT mail DOT gmail DOT com>
<c772b67d-be50-5b75-1b2b-99d9f1c5a717 AT cs DOT umass DOT edu>
MIME-Version: 1.0
In-Reply-To: <c772b67d-be50-5b75-1b2b-99d9f1c5a717@cs.umass.edu>
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On Apr 21 21:35, Eliot Moss via Cygwin wrote:
> On 4/21/2024 7:20 PM, Dan Shelton via Cygwin wrote:
> > On Sat, 20 Apr 2024 at 07:39, Brian Inglis via Cygwin <cygwin AT cygwin DOT com> wrote:
> > > 
> > > On 2024-04-19 17:47, Dan Shelton via Cygwin wrote:
> > > > On Fri, 23 Feb 2024 at 22:25, Dan Shelton wrote:
> > > > > Is there a package which provides /usr/bin/sg (execute shell commands
> > > > > in a different group)?
> > > 
> > > The POSIX standard command is newgrp - install cygwin-doc to see Cygwin (and
> > > newlib libc) man pages (and info, html, PDF docs), man-pages-posix to see POSIX
> > > man pages, and man-pages-linux if you want to see recent Linux release man pages.
> > > 
> > > To see possibly relevant commands, run:
> > > 
> > > $ apropos -s 1,1p group
> > > chgrp (1)            - change group ownership
> > > chgrp (1p)           - change the file group ownership
> > > chown (1)            - change file owner and group
> > > g3topbm (1)          - convert a Group 3 fax file into a PBM image
> > > groups (1)           - print the groups a user is in
> > > id (1)               - print real and effective user and group IDs
> > > make (1)             - GNU Make utility to maintain groups of programs
> > > make (1p)            - maintain, update, and regenerate groups of programs
> > > mkgroup (1)          - Write /etc/group-like output to stdout
> > > newgrp (1)           - change primary group for a command
> > > newgrp (1p)          - change to a new group
> > > pbmtog3 (1)          - convert a PBM image into a Group 3 MH fax file
> > 
> > newgrp(1) is USELESS. It only opens an interactive shell, but does not
> > allow the user to execute a non-interactive script with the requested
> > group like bash -c does.
> 
> ??
> 
> The man pages has:
> 
>  newgrp [-] [group] [command [args...]]
> 
> which implies to me that you can give a command.
> 
> Did that not work for you?  EM

WJFFM:

  $ id
  uid=1049577(corinna) gid=1049701(vinschen) groups=1049701(vinschen),545(Users),14(REMOTE INTERACTIVE LOGON),4(INTERACTIVE),11(Authenticated Users),15(This Organization),4095(CurrentSession),66048(LOCAL),1049089(Domain Users),70145(Authentication authority asserted identity),1049148(Denied RODC Password Replication Group),401408(Medium Mandatory Level)
  $ newgrp Users id -g
  545


Corinna

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

- Raw text -


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