I am working on a script about ip location lookup.
I 've a decimal list
dec_list:
16777216,17367039,AU,AUS,AUSTRALIA
17367040,17432575,MY,MYS,MALAYSIA
17432576,17498111,AU,AUS,AUSTRALIA
17498112,17563647,KR,KOR,REPUBLIC OF KOREA
17563648,17825791,CN,CHN,CHINA
17825792,18087935,KR,KOR,REPUBLIC OF KOREA
18087936,18153471,AU,AUS,AUSTRALIA
18153472,18219007,JP,JPN,JAPAN
18219008,18350079,IN,IND,INDIA
18350080,18874367,CN,CHN,CHINA
18874368,18939903,AU,AUS,AUSTRALIA
bla bla bla...
And I have an ip.log
2.16.170.4
8.16.170.4
7.16.170.4
6.16.170.4
5.16.170.4
4.16.170.4
2.13.173.6
2.16.170.5
78.161.18.60
14.16.170.4
13.16.170.4
12.16.170.4
11.13.173.6
bla bla bla...
So my script:
Yes all of this. The problem is my script does not work for line-up in the ip.log and does not find for all ips in the ip.log. I can't understand why it is. But I need a help.. I searched for this a lot of times but I haven't found a info about this which is for me..
I Wait for your help..
sorry,
that' the output. If u re check it you will see the line up is not same with ip log file.
---------- Post updated at 12:16 PM ---------- Previous update was at 12:08 PM ----------
this is the another output for you. I append a command for show i variable. Sıra is meaning line up. I think this is easier than the previous one.
---------- Post updated at 12:59 PM ---------- Previous update was at 12:16 PM ----------
OK! : )
I solved it...,
The problem resulted from For Loop. I positioned the wrong line for loop. It must be top of the while. So it is working according to lines in ip list.
In the previous one was working according to decimal list.
A) I would like to achive following actions using shell script. can someone help me with writing the shell script
1) Go to some dir ( say /xyz/logs ) and then perform find operation in this dir and list of subdir using
find . -name "*" -print | xargs grep -li 1367A49001CP0162 >... (1 Reply)
Hi
This is my third past and very impressed with previous post replies
Hoping the same for below query
How to find a existing file location and directory location in solaris box (1 Reply)
I have file file1.txt in location 'loc1'. Now i want a copy of this file in location 'loc2' with a new file called test.txt.
Please help me how to do this in shell script. (1 Reply)
Hi,
I am logging to a linux server through a user "user1" in /home directory.
There is a script in a directory in 'root' for which all permissions are available including the directory. This script when executed creates a file in the directory.
When the script is added to crontab, on... (1 Reply)
Hi,
I am new to unix and shell scripting.
Please help me in resolving the below issue.
In my shell script I have a variable which stores the different files with the path. Now I need to move all the files one by one to another location.
----
1.... (4 Replies)
Create a script that copies files from one specified directory to another specified directory, in the order they were created in the original directory between specified times. Copy the files at a specified interval. (2 Replies)
I need help in forming a script to copy files from one location which has a sub directory structure to another location with similar sub directory structure,
say location 1,
/home/rick/tmp_files/1-12/00-25/
here 1-12 are the number of sub directories under tmp_files and 00-25 are sub... (1 Reply)
Write a quick shell snippet to find all of the IPV4 IP addresses
in any and all of the files under /var/lib/output/*, ignoring
whatever else may be in those files. Perform a reverse lookup on
each, and format the output neatly, like "IP=192.168.0.1,
... (0 Replies)