The UNIX and Linux Forums  

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
EPTS Working Groups, on the starting blocks iBot Complex Event Processing RSS News 0 12-15-2008 07:00 PM
Where are my groups mhenryj AIX 4 01-21-2008 06:54 PM
Secondary groups show in groups but don't show in id (Not working) zen03 HP-UX 4 12-31-2007 11:15 AM
Users and groups rsanz Security 2 08-05-2002 03:46 PM
Groups Rights niasdad UNIX Desktop for Dummies Questions & Answers 3 07-16-2002 10:01 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-31-2009
gehlnar gehlnar is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 47
groups starting with c2?

I have some groups and when i issue a command like
groups $LOGNAME
it displays in one line
rfautosys c2ru cash2
I want to fetch only group starting with c2 but when i grep i am getting full line. Can someone advise
on this please as how i can get output as c2ru?
  #2 (permalink)  
Old 03-31-2009
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
Wink

what if you try

Code:
groups | tr " " "\n" | grep "^c2"

  #3 (permalink)  
Old 03-31-2009
gehlnar gehlnar is offline
Registered User
  
 

Join Date: Jan 2009
Posts: 47
Smile

Thanks Joeyg, This is what i was looking.

Cheers,
gehlnar
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 08:23 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