HPE GreenLake Administration
Operating System - HP-UX
1837257
Members
2411
Online
110115
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:50 AM
03-24-2003 06:50 AM
newgrp
I have several users on my system which are members of several groups. They need to be able to switch between their groups (as defined by /etc/groups) when in certain areas so that files are created using the correct group ID. newgrp seems to do this, however, I'm trying to automate it. They have a file which they must source each time they change application "levels". In this file, all kinds of variables are set, and I'd like newgrp to be in there as well. The problem is that anything in the script after the newgrp command is discarded. While making it the last line of the file makes that problem go away, when this file is then sourced from within a script, the part of the script after the sourcing is discarded. Anyone know of a way to do this?
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:54 AM
03-24-2003 06:54 AM
Re: newgrp
NAME
newgrp - switch to a new group
The newgrp command changes your group ID without changing your user ID
and replaces your current shell with a new one.
Its a command to be executed by the user, replacing the shell. Sourcing it would not seem the right approach.
SEP
newgrp - switch to a new group
The newgrp command changes your group ID without changing your user ID
and replaces your current shell with a new one.
Its a command to be executed by the user, replacing the shell. Sourcing it would not seem the right approach.
SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 06:57 AM
03-24-2003 06:57 AM
Re: newgrp
It does function however. Maybe it's not the right command to do what I need to do. Basically, I need to switch the default gid of the process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2003 07:23 AM
03-24-2003 07:23 AM
Re: newgrp
Sounds like you've got several processes all with unique groups. Identifying groups by process should be easy enough since processes will contain the UID and GID.
ps -j (* pgid *)
Something like:
GPID=$(ps -j | grep -i process_name| awk '{ print $4 )'
Then,
newgrp $GPID
ps -j (* pgid *)
Something like:
GPID=$(ps -j | grep -i process_name| awk '{ print $4 )'
Then,
newgrp $GPID
Support Fatherhood - Stop Family Law
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP