The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How can i allow only a group of users in NIS? younus_syed SUN Solaris 9 09-10-2008 07:41 PM
SSH for a group of users ? deepusunil Shell Programming and Scripting 3 07-22-2008 12:57 PM
Max users in a group ? anmiller AIX 4 09-05-2007 07:32 PM
command to add users to group Terrible Shell Programming and Scripting 2 12-19-2006 02:30 AM
Adding users to /etc/group golfhakker UNIX for Dummies Questions & Answers 1 03-30-2006 05:27 PM

Reply
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 07-20-2009
dplate07
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
Diffferentiate group from users

Im trying to put all the groups in into a variable called $GROUP, however in /etc/group there are also lotsa users. And the GID of group can differ as it can be set, this there is no specific range, how can i put all the names of the groups into that variable?
  #2 (permalink)  
Old 07-20-2009
scottn scottn is online now Forum Advisor  
VIP Member
  
 

Join Date: Jun 2009
Location: Zürich, CH
Posts: 1,057
Code:
GROUPS=$(cut -d: -f1 /etc/group)
  #3 (permalink)  
Old 07-20-2009
dplate07
Guest
  
 

Posts: n/a
Bits: 0 [Banking]
The further code does not differentiate groups from users, it only displays the first column... any other solution to display GROUPS only ?
  #4 (permalink)  
Old 07-20-2009
pludi's Avatar
pludi pludi is online now Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,877
Just as a hint: /etc/password only contains users in the first field, /etc/group only users, even if they sometimes have the same name.
Reply

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 02:56 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