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
mail, aliases, pager itik AIX 2 01-30-2008 11:57 PM
man aliases Pipa UNIX for Dummies Questions & Answers 2 09-19-2007 06:55 AM
aliases BG_JrAdmin UNIX for Dummies Questions & Answers 1 11-30-2005 11:53 PM
NIS map mail.aliases specified, but NIS not running stancwong UNIX for Dummies Questions & Answers 2 08-29-2005 09:29 PM
aliases mluey61 High Level Programming 1 04-19-2005 11:30 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-16-2007
Kumarsharad Kumarsharad is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 2
/etc/mail/aliases

HI

I have 5000 users on sendmail server, also there entries of these users Mail ID in /etc/mail/aliases as per Diparments. Same Mail ID can occures in Diff Departments as per req.
I have to remove 500 users from server also there entry from /etc/mail/aliases file. which occures many times.

IS there any script to remove the ID's from this file at a time

Thanks
Kumarsharad
  #2 (permalink)  
Old 07-16-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,206
If you have a file with the users listed in it one per line this might work for you:

Code:
cp /etc/mail/aliases /etc/mail/aliases.orig
fgrep -vwf file /etc/mail/aliases.orig > /etc/mail/aliases
I suggest you verify the file before doing:
Code:
newaliases
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 12:40 PM.


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