[lug] newgrp and aliases

Jeffrey S. Haemer jeffrey.haemer at gmail.com
Wed Jan 16 15:09:49 MST 2013


Does putting  "exit 0" right after the call to newgrp work?  Seems to me
that when you log out of the subshell, it should go on to execute the next
line in ~/.bash_login, but I haven't actually tried it.


On Wed, Jan 16, 2013 at 2:56 PM, Davide Del Vento <
davide.del.vento at gmail.com> wrote:

> Of course I meant:
>
> wanted_group=<string-of-wanted-group>
> my_current_group=`id -g -n`
> if [[ $my_current_group == $wanted_group ]]; then
>   #rest-of my bash_profile so it doesn't get executed twice
> else
>   newgrp - $wanted_group
> fi
>
>
> And this works great :-))))
>
> Any trick to make the exit command exiting twice? Of course alias
> exit='exit;exit' doe not work.
>
> Cheers,
> Davide
>
>
> On Wed, Jan 16, 2013 at 2:50 PM, Davide Del Vento <
> davide.del.vento at gmail.com> wrote:
> > You are so cool, Jeffrey :-)
> >
> > I just made it slightly smarter
> >
> > wanted_group=<string-of-wanted-group>
> > my_current_group=`id -g -n`
> > if [[ $my_current_group != $wanted_group ]]; then
> >   #rest-of my bash_profile so it doesn't get executed twice
> >   newgrp - $wanted_group
> > fi
>
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>



-- 
Jeffrey Haemer <jeffrey.haemer at gmail.com>
720-837-8908 [cell], http://seejeffrun.blogspot.com [blog],
http://www.youtube.com/user/goyishekop [vlog]
*פרייהייט? דאס איז יאַנג דינען וואָרט.*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20130116/007e0795/attachment.html>


More information about the LUG mailing list