groups starting with c2?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting groups starting with c2?
# 1  
Old 03-31-2009
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  
Old 03-31-2009
Hammer & Screwdriver

what if you try
Code:
groups | tr " " "\n" | grep "^c2"

# 3  
Old 03-31-2009
Bug

Thanks Joeyg, This is what i was looking.

Cheers,
gehlnar
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to grep a line not starting with # from a file (there are two lines starting with # and normal)?

e.g. File name: File.txt cat File.txt Result: #INBOUND_QUEUE=FAQ1 INBOUND_QUEUE=FAQ2 I want to get the value for one which is not commented out. Thanks, (3 Replies)
Discussion started by: Tanu
3 Replies

2. Solaris

Groups is not visible

OS : SunOS 5.8 I am trying to add a user ad3059 to the following groups, A B C D ( four groups A,B,C,D) When i use usermod command and add the user to the above groups, and go to > groups ad3059 other C D It doesnt show A and B groups and shows it as other.Please advice on how... (13 Replies)
Discussion started by: Revathi2089
13 Replies

3. Shell Programming and Scripting

Sorting in groups

Hi, I am looking at a slightly different sorting problem and I am not sure how to do it in bash. I have the following input: 0 ... (8 Replies)
Discussion started by: jamie_123
8 Replies

4. UNIX for Dummies Questions & Answers

Groups

Must I be in a group? I am using Ubuntu and am the only user on my PC. I know how to change groups but do not see a way to not be in a group. Any help would be appreciated. (2 Replies)
Discussion started by: nthepines
2 Replies

5. Solaris

groups

1 user in member of 4 groups find file permissions and default group (1 Reply)
Discussion started by: tirupathi
1 Replies

6. Solaris

groups

how to create 1000 users in 1 group (0 Replies)
Discussion started by: tirupathi
0 Replies

7. AIX

Where are my groups

Hello A couple of weeks ago, I added a user to an AIX 5.3 system. I go to add one today, and it appears that when creating a user in smit, I cannot see any groups. No primary groups No Group set No Admin Groups The /etc/group and etc/secuity/group files seem to be intact. I did... (4 Replies)
Discussion started by: mhenryj
4 Replies

8. Solaris

Adding new groups!!

I want to know how we can add a new group in solaris. As per my understanding this is done by adding a new entry in /etc/groups file (or by using groupadd command which will also add the entry in the groups file). But when I use group command to see the groups to which I belong, it shows my userid... (7 Replies)
Discussion started by: atheek
7 Replies

9. UNIX for Dummies Questions & Answers

Advantages of Groups

What are the advantages of putting users into groups? I understand that in a corporate environment, you should create a group for each department. ie: putting finance employees into a finance group. But are there any system advantages for doing that? How would it make it easier on the system... (3 Replies)
Discussion started by: kurtmc
3 Replies
Login or Register to Ask a Question