Im looking to help out my team by automating a simple search list. The user will look for a peering ip /30. For example 192.168.1.2/30 and gets the result. Im trying to get the entered /30 and subtract the last octet by one.
(but nothing happens and I get is 217.30.80.110-1) I have trued to subtract also by
( nothing either)
Can someone help me out here?
Last edited by Scrutinizer; 09-03-2015 at 08:52 AM..
Reason: code tags
Please use code tags for your posts, following may help you in same. Kindly try to show us some sample inputs
and expected output from your side, it will be good for us to understand your requirement more closely.
Let's say we have a input file with following details.
Now we can use following script named checkip.ksh to get this done as follows.
Execution and output will be as follows.
Hope this helps you. Enjoy learning
Experts,
In one example I have seen how to get output upto 3rd octet, when there is a ":" separated with the 4rth octet.
However in this example how to remove 4rth octet and to keep upto 3rd octet with regular expressions and awk sub function:
I have tried with :but not working:
# awk '{... (3 Replies)
Hi Experts,
I am trying to print $2 & the IP_address upto 3rd octet only.
But unable to do so, Trying # awk '{print $2, substr($4,1,9)}' file . but not correct
File:
HOST= cmiHOST06 :: 10.26.107.73:/data120 /nbu/cmiHOST06/athpx07/aa1
HOST= cmiHOST05 :: 10.26.12.76:/data120... (5 Replies)
Hi friends,
My input file is this way
chr1 100 200 "abc"
chr1 350 400 "abc"
chr2 450 600 "def"
chr2 612 780 "def"
How do I make this file into
chr1 100 400 "abc"
chr2 450 780 "def"
This is basically matching on the fourth column and taking the minimum of second column and the... (4 Replies)
I'm trying to learn as much about GRUB as I can and it's stages are stored in these types of files.
Any info or search terms is appreciated!:wall: (5 Replies)
Hi ,
Please help me to get the data extracted between the 3rd and 4th dot of a transaction file.
Source data
TRANS,ARRIVED,ABC.1Gt.CDRFLOW123.MAINFRAMES.SYS.tXT/ARRIVED,TRANS/CDRFLOW123.MAINFRAMES.SYS.tXT/ARRIVED,TRANS ... (1 Reply)
cat test.nmea|awk 'NR%3!=0'
This deletes the 3rd line, or I can delete the fourth but I can't figure out how to delete the 3rd and 4th together. I'm looking for a quick way to make a GPS log half its size.
Also how do I pipe the output to another file?
Hope someone can help! (5 Replies)
hi
i hav a file like
121212 asdd d 7 dfsdffdffsdfsdfsdfdf rrretrtrtre
121212 asdd d 5 dfsdffdffsdfsdfsdfdf rrretrtrtre
121212 asdd d 5 dfsdffdffsdfsdfsdfdf rrretrtrtre
121212 asdd d 4 dfsdffdffsdfsdfsdfdf rrretrtrtre
121212 asdd d 6 dfsdffdffsdfsdfsdfdf rrretrtrtre
i need to... (4 Replies)
Hi All,
I found my weblog contain entries like 121.23.3 Instead of four octet.
I am quite confused is it possible to have 3 octet ip at all ??
Is it generating by any program and hittng the website ?
Is it a subdomain ?
Please tell me your understanding on it ?
Thanks (4 Replies)
Hi all,
Situation is as below.
I would get an IP address and port from eithe r a file or command line. It probably would be as char * or string. So was wondering how I could accept this and increment the last octets?
Incrementing the port is fine. I could get that into an integer by atoi()... (8 Replies)