Chet, The Solaris ksh93-integration version of ksh93 has a newgrp -c option (David Korn, Glenn Fowler and Roland Mainz did implement it), which works like ksh93/bash -c, and executes script under the requested group, and upon exiting resumes the old shell with the old group.
Could you please implement this (newgrp -c 'command') in the bash newgrp builtin too? Ced ---------- Forwarded message --------- From: Dan Shelton via Cygwin <cyg...@cygwin.com> Date: Mon, 22 Apr 2024 at 01:20 Subject: Re: /usr/bin/sg in Cygwin? To: <cyg...@cygwin.com> On Sat, 20 Apr 2024 at 07:39, Brian Inglis via Cygwin <cyg...@cygwin.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. Dan -- Dan Shelton - Cluster Specialist Win/Lin/Bsd -- 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 -- Cedric Blancher <cedric.blanc...@gmail.com> [https://plus.google.com/u/0/+CedricBlancher/] Institute Pasteur