Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!ames!pacbell!att!chinet!john From: john@chinet.chi.il.us (John Mundt) Newsgroups: comp.unix.questions Subject: Re: newgrp in shell programs Message-ID: <9041@chinet.chi.il.us> Date: 22 Jul 89 16:54:44 GMT References: <124@sdcc10.ucsd.EDU> <127@sdcc10.ucsd.EDU> Reply-To: john@chinet.chi.il.us (John Mundt) Organization: Chinet - Public Access Unix Lines: 35 In article <127@sdcc10.ucsd.EDU> bruno@sdcc10.ucsd.EDU (Bruce W. Mohler) writes: >In article <124@sdcc10.ucsd.EDU>, bruno@sdcc10.ucsd.EDU (Bruce W. Mohler) writes: >> Is it possible to do a newgrp near the beginning of >> a shell program (especially one that has been started by cron)? > >Thanks to Ihor Kinal and Paul Hite for providing me >2 different answers to my problem. The answer that >best solves my problem is > --> From: ijk@cbnewsh.ATT.COM (ihor.j.kinal) > --> Here's one thing that comes to mind [I've tried it and it does work]" > --> newgrp NEW_GROUP < --> shell script goes here > --> ! > --> -------------------- > --> Of course, when you're done, you're logged off the machine You really should't get logged off, but if it's a problem, you can put the whole mess inside of a subshell so that you'll get your old prompt back afterwards: ( newgrp NEW_GROUP <