Sponsored Content
Full Discussion: sort file with email adress
Top Forums Shell Programming and Scripting sort file with email adress Post 302575228 by ace_friends22 on Monday 21st of November 2011 02:08:26 AM
Old 11-21-2011
sort file with email adress

Hi All,

I have a file which is "|" pipe delimited. The file has 3 fields. the last field contains email ids which has different host names.

I want to sort the file based on host name, which is in 3rd filed and needs to create a file for each host.

For example, if out of 1000 records, 10 records have host name @yahoo.com, i need to create file yahoo with all these 10 records.

Till now i have written below commands, but it is not helping me.

Code:
awk -F"@" '{print $2}' ABC.txt | sort -u >> a.txt
 
cat a.txt | whil read abc 
do
grep ${abc} | ABC.txt >> abc.txt
done

Any help? it creates the file, but it is not taking all records for a domain.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

MAC-Adress

Hello I need to show my MAC-Adress on a Unix System, is there someone that know how? (2 Replies)
Discussion started by: nkochr
2 Replies

2. Solaris

IP-Adress

Hello together how can I find a ipadress from a login into remote system console? Thanks a lot Urs (1 Reply)
Discussion started by: MuellerUrs
1 Replies

3. AIX

Capture IP Adress

hello I need for a script to capture the ip address from the connected user. I have 5 logical partitions. With "who", i have the ip adress, but only for 2 servers. Do you know another command to know the ip address of connected clients ? thank you (14 Replies)
Discussion started by: pascalbout
14 Replies

4. HP-UX

Change IP Adress

I want change my IP address and hostname in my machine by use the console. Can any one tell me how can I execute that by command ? Thanks & Regards (1 Reply)
Discussion started by: magasem
1 Replies

5. Shell Programming and Scripting

To find the IP adress in the log file

Hi, I need to find out the repeated IP address from the apache log file from my box. I did try to come out with the script, but I could not grep out the repeated Ip Address from the error_logs and need to redirect to a file. Can you guys please help me out of this problem. Thanks in... (9 Replies)
Discussion started by: gsiva
9 Replies

6. Shell Programming and Scripting

Trying to get an IP adress from a file

This is probably a real n00b question but i`m not able to figure it out. I have a folder of configuration files that contain IP-adresses. The line i`m interested in looks like this: IP_ADDRESS="123.123.123.1123" Some have muliple ip adresses, so the line will look like : ... (5 Replies)
Discussion started by: DaneV
5 Replies

7. UNIX for Advanced & Expert Users

Script to sort the files and append the extension .sort to the sorted version of the file

Hello all - I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Discussion started by: pankaj80
3 Replies

8. Shell Programming and Scripting

Sort help: How to sort collected 'file list' by date stamp :

Hi Experts, I have a filelist collected from another server , now want to sort the output using date/time stamp filed. - Filed 6, 7,8 are showing the date/time/stamp. Here is the input: #---------------------------------------------------------------------- -rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies

9. UNIX for Beginners Questions & Answers

awk script to find repeated IP adress from trace file (.tr)

+ 8.00747 /NodeList/0/DeviceList/0/$ns3::PointToPointNetDevice/TxQueue/Enqueue ns3::PppHeader (Point-to-Point Protocol: IP (0x0021)) ns3::Ipv4Header (tos 0x0 DSCP Default ECN Not-ECT ttl 63 id 0 protocol 17 offset (bytes) 0 flags length: 540 10.1.3.3 > 10.1.2.4) ns3::UdpHeader (length: 520 49153 >... (11 Replies)
Discussion started by: Nipa
11 Replies
eurephiadm certs(7)													       eurephiadm certs(7)

NAME
eurephiadm-certs - Certificate management for eurephia DESCRIPTION
Available modes for the certificate command are: -A | --add Register a new certificate -D | --delete Delete a registered certificate -l | --list List all registered certificates -h | --help <mode> Help about a specific mode LIST MODE
The list mode will list all registered certificates. It accepts one parameter: -S | --sort <sort key> Decide the sort order of the certificate list Available sort keys are: certid Numeric certificate ID depth Certificate depth digest Certificate SHA1 digest cname Certificate Common Name field org Certificate organisation field email Certificate e-mail address field registered When the certificate was registered in eurephia. ADD MODE
The add mode will register a new certificate. -d | --depth Certificate depth, required. -D | --digest SHA1 fingerprint/digest of the new certificate -C | --common-name Common name (CN) field of the certificate -O | --organisation Organisation (O) field of the certificate -E | --email e-mail address (emailAddress) of the certificate Usually the certificate depth value needs to be 0, if you are registering user account certificates. CA certificates usually have a value bigger than 0. If you have the certificate file available, you can use the following options to retrieve the needed information directly from a certifi- cate file. -f | --certfile File name of the certificate file. -p | --pkcs12 If the file is in PKCS#12 format. The default format is PEM format, unless --pkcs12 is given. These two options cannot be used together with -D, -C, -O or -E. But the cer- tificate depth must be given to indicate the certificate depth. DELETE MODE
The delete mode will remove a certificate from the certificate database. -i | --certid Indicates a unique certificate ID -d | --digest A unique SHA1 fingerprint/digest value -C | --common-name Common Name (CN) field of a certificate -O | --organisation Organisation (O) field of a certificate -E | --email e-mail address (emailAddress) of a certificate You can use any of these parameters to indicate a search criteria for the certificate (or certificates) you want to delete. You will be provided with a list over certificates which matches your search criteria and you will need to approve the deletion of the matching cer- tificate(s). SEE ALSO
eurephiadm-users(7), eurephiadm-usercerts(7) AUTHOR
Copyright (C) 2008-2010 David Sommerseth <dazo@users.sourceforge.net> David Sommerseth July 2010 eurephiadm certs(7)
All times are GMT -4. The time now is 11:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy