Hi forum. I am fairly new to scripting and use a simple script to process e-mails for my work. These e-mails contain a list of IPv4 IPs that I process and seperate into text files, which are then attached to a larger, 'digest' e-mail. I also put some of the output from the text files into the body of the e-mail. The script currently outputs supported and unsupported IPs into the body of the e-mail, with these two lines:
And unsupported:
A mess of greps, I'm sure. The script pulls all IP addresses from the e-mail (the IPs reside in the body of the e-mail) via a regexp match (1), either compares or takes a difference to a list of IPs, then goes further and compares the IPs to a list of unsupported reverse DNSes.
The end result is a raw output of a reverse DNS lookup, such as :
What I would like to do, while still retaining the functionality I have outlined, is display the IP, count how many occurrences, and put the number in a formatted manner adjacent to the IP.
Ideally, it would also show which ISP the IP belongs to, either by attaching part of a DHCP-style reverse lookup to it, such as which would require a whois lookup.
This is similar to the reverse DNS lookup output I would like to process:
91.120.97.76.in-addr.arpa name = c-76-97-120-91.hsd1.ga.comcast.net
To display only the "ga.comcast.net" next to it, but just showing the "comcast.net" would be sufficient and probably easier, since every IP I process isn't always in a similar format. My scripting abilities are somewhat limited, and while I am pretty handy with grep and it's variants, I know very little of the magic of awk and more specifically, sed. Can this be done?
hi forums
i need help with a little problem i am having.
i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly.
is there a way of doing this without using SED/AWK?
anything would be greatly appreciated (4 Replies)
I currently use LaTeX together with a sed script to set cloze test papers for my students. I currently pepend and equals sign to the front of the words I want to leave out in the finished test, =perpendicular, for example. I am able to number the blanks using a variable in LaTeX. I would like to... (8 Replies)
Please find the input file as given below:
2012/02/29 11:00:00~~CRITICAL~For customer 00000476 no daily files were found in the 010137933 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05006802 no daily files were found in the 010115166 account directory.
2012/02/29... (0 Replies)
We have the following output:
server1_J00_data_20120711122243
server1_J00_igs_20120711122243
server1_J00_j2ee_20120711122243
server1_J00_sec_20120711122243
server1_J00_data_20120711131819
server1_J00_igs_20120711131819
server1_J00_j2ee_20120711131819
server2_J00_data_20120711122245... (10 Replies)
I have a file of 100,000 lines in the below format:
answer.bed
chr1 957570 957852
NOC2L
chr1 976034 976270
PERM1
chr1 976542 976787
PERM1
I need to get each on one line and so far what I have tried doesn't seem to be working. Thank you... (3 Replies)
The awk below runs and produces the following output on the file2. This is just an example of the format as the file is ~14MB. file1.txt is attached. I am trying to count the ids that match between the two files and out the ids that are missing. Thank you :).
file2
970 NM_213590 ... (2 Replies)
In the below awk I am trying output to one file those lines that match between $2,$3,$4 of file1 and file2 with the count in (). I am also trying to output those lines that are missing between $2,$3,$4 of file1 and file2 with the count of in () each. Both input files are tab-delimited, but the... (7 Replies)
Hi Friends ,
I am having one problem as stated file .
Having an input CSV file as shown in the code
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_2_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0... (4 Replies)
Hi,
I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output
Here is how my file looks like
1.1.1.1
1.1.1.2
1.1.1.3
1.1.2.1
1.1.2.2
1.1.3.1
1.1.3.2
1.1.3.3
1.1.3.4
So what I am trying... (2 Replies)