newgrp in shell programs

Bruce W. Mohler bruno at sdcc10.ucsd.EDU
Sat Jul 22 14:01:55 AEST 1989


In article <124 at sdcc10.ucsd.EDU>, bruno at 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)?  ...
> 
> I understand that newgrp creates a new shell process,
> but knowing this has not helped me to figure out whether
> what I want to do is possible...
> 
> ...
>
> All suggestions and directions are appreciated, in advance!!!!

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

Thanks again!
-- 
Bruce W. Mohler
Systems Programmer (aka Staff Analyst)
bruno at sdcc10.ucsd.edu
voice: 619/586-2218



More information about the Comp.unix.questions mailing list