Sponsored Content
Top Forums Shell Programming and Scripting help to separate name and email domain Post 302451499 by Klashxx on Tuesday 7th of September 2010 04:45:33 AM
Old 09-07-2010
You can archieve it with perl withou using any external process:
Code:
perl -e 'while(<>){chomp;/^[^@]+@([^@]+)$/;$h{$1}++;}
foreach $k (sort { $h{$b} <=> $h{$a} } keys %h)  {print $h{$k}." ".$k."\n";} infile

 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Send email with attachement-Getting connection refused by domain

Hi all, I am a newbie to unix. I need to send an email with an attachment in unix to some id like abc@some_company.com Code i have used is ------------Code--------------------------- #!/bin/ksh set -x #set -n #cript: unix_mail_withattachments.ksh # Aurthor: Ravin Maharaj #... (1 Reply)
Discussion started by: samuelc
1 Replies

2. Solaris

can't email my own domain

I am not able to send email only to my own domain with sendmail. I am having trouble determining if the problem is name resolution on the box in question, or if the email is getting stopped at the mail relay/spam appliance. I would appreciate any insights into this problem. Could it be the... (0 Replies)
Discussion started by: lscritch
0 Replies

3. Windows & DOS: Issues & Discussions

How to: Linux BOX in Windows Domain (w/out joining the domain)

Dear Expert, i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant. ... (2 Replies)
Discussion started by: regmaster
2 Replies

4. UNIX for Advanced & Expert Users

Sending email to different domain

Hi, I am looking for info based on direct experience in using DataStage EE with Unix. A scenario in the client remote desktop I work for company Switch, my client is Master. Notification Activity Stage (IBM Asential Data Stage component) SMTP Mail server name is blank. Sender... (1 Reply)
Discussion started by: dsnaveen
1 Replies

5. Shell Programming and Scripting

Using top command to email if process is exceeding 25% and sending an email alert if so

This is my first time writing a script and Im having some trouble, Im trying to use the top command to monitor processes and the amount of CPU usage they require, my aim is to get an email if a process takes over a certain percentage of CPU usage I tried grep Obviosly that hasnt worked, Any... (8 Replies)
Discussion started by: jay02
8 Replies

6. Red Hat

Not able to send an email from a particular domain.

HI Gurus, I have a RHEL (5.5) VM. I am able to send email to a particular domain abc.com but when I am trying to send a different domain(xyz.com) it is not working can you please throw some light on how to start debugging this issue. Thanks in advance. RK (0 Replies)
Discussion started by: rama krishna
0 Replies

7. Solaris

When do you need a separate service/IO domain?

Looking at latest recommendations - http://www.oracle.com/technetwork/server-storage/vm/ovmsparc-best-practices-2334546.pdf - specifically regarding domain roles. At the moment, we just have a physical host, primary control domain and then guest ldoms. We then export things like vdisks,vnet etc... (2 Replies)
Discussion started by: psychocandy
2 Replies
Log::Dispatch::Email(3pm)				User Contributed Perl Documentation				 Log::Dispatch::Email(3pm)

NAME
Log::Dispatch::Email - Base class for objects that send log messages via email VERSION
version 2.32 SYNOPSIS
package Log::Dispatch::Email::MySender; use Log::Dispatch::Email; use base qw( Log::Dispatch::Email ); sub send_email { my $self = shift; my %p = @_; # Send email somehow. Message is in $p{message} } DESCRIPTION
This module should be used as a base class to implement Log::Dispatch::* objects that send their log messages via email. Implementing a subclass simply requires the code shown in the SYNOPSIS with a real implementation of the "send_email()" method. CONSTRUCTOR
The constructor takes the following parameters in addition to the standard parameters documented in Log::Dispatch::Output: o subject ($) The subject of the email messages which are sent. Defaults to "$0: log email" o to ($ or @) Either a string or a list reference of strings containing email addresses. Required. o from ($) A string containing an email address. This is optional and may not work with all mail sending methods. o buffered (0 or 1) This determines whether the object sends one email per message it is given or whether it stores them up and sends them all at once. The default is to buffer messages. METHODS
o send_email(%p) This is the method that must be subclassed. For now the only parameter in the hash is 'message'. o flush If the object is buffered, then this method will call the "send_email()" method to send the contents of the buffer and then clear the buffer. o DESTROY On destruction, the object will call "flush()" to send any pending email. AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-05-25 Log::Dispatch::Email(3pm)
All times are GMT -4. The time now is 11:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy