The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
close existing tcp connection in C raidzero High Level Programming 6 01-21-2009 02:41 PM
folder existing and file existing crowman Shell Programming and Scripting 4 08-28-2008 07:07 PM
usermod -G and Group id login replacing existing groups pbsrinivas UNIX for Dummies Questions & Answers 6 11-02-2006 10:09 PM
link a new .so with an existing .so baosoccer High Level Programming 0 05-27-2003 02:17 PM
Assigning existing users to a secondary group jyotipg UNIX for Dummies Questions & Answers 1 05-15-2002 04:45 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-05-2009
a2156z a2156z is offline
Users Awaiting Email Confirmation
  
 

Join Date: Oct 2008
Posts: 30
Add existing user into an existing group

Pre: no gpasswd/adduser

there is just usermod can be used, also there is no -a option for usermod.

How should I add a user into a group?
  #2 (permalink)  
Old 03-05-2009
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,461
"usermod -G group user"
  #3 (permalink)  
Old 03-05-2009
frozentin frozentin is offline
Registered User
  
 

Join Date: May 2008
Location: Vienna, VA + Bombay, India
Posts: 109
edit the /etc/group file and you will be good to go.
  #4 (permalink)  
Old 03-05-2009
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlosuǝdo
  
 

Join Date: Dec 2007
Location: Paris
Posts: 1,461
Yes, vi is what I would use. Here is something that should work if scripting is a requirement. I misunderstood the question in my first answer.

Code:
usermod -G $(groups user| sed -e 's/.*: *//' -e 's/  */,/g'),group user

  #5 (permalink)  
Old 03-05-2009
frozentin frozentin is offline
Registered User
  
 

Join Date: May 2008
Location: Vienna, VA + Bombay, India
Posts: 109
Quote:
Originally Posted by jlliagre View Post
Yes, vi is what I would use. Here is something that should work if scripting is a requirement. I misunderstood the question in my first answer.

Code:
usermod -G $(groups user| sed -e 's/.*: *//' -e 's/  */,/g'),group user
THAT took me 17 minutes to decipher. Now I know why I love VEE EYE

But, at work I usually use a combination of cut and tr to achieve the same; switching to this from now on. Thanks!
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0