1836647 Members
1760 Online
110102 Solutions
New Discussion

Help with a script

 
SOLVED
Go to solution
Joanne Keegan
Regular Advisor

Help with a script

Hi Everyone,

This is probably quite simple, but I haven't done any scripting for a while, and I don't have the time to sit down and figure things out. Hopefully someone will be able to answer this question for me.

I have a list of users (their login id's) and I want to produce a new listing of users excluding say five specific ones from the original list.

For example, the list maybe:

John
Bob
Mark
Tom
Mary

And I want the final list to exclude Bob, and Mary.

So final list will be: John,Mark and Tom.

Any ideas?? I do award points!

Regards,

Jo
2 REPLIES 2
Darrell Allen
Honored Contributor
Solution

Re: Help with a script

Hi Jo,

egrep -v "Bob|Mary" list >short.list

or

grep -ve Bob -e Mary list >short.list

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Joanne Keegan
Regular Advisor

Re: Help with a script

Thanks Darrell for the quick response.

It works.

Jo