Search Results

Search: Posts Made By: azdps
13,415
Posted By vgersh99
Well done research/troubleshooting. Thanks for...
Well done research/troubleshooting.
Thanks for sharing!
13,415
Posted By vgersh99
Glad it worked out for you! Cheers!
Glad it worked out for you!
Cheers!
13,415
Posted By Don Cragun
Please show us the last two lines in your input...
Please show us the last two lines in your input file that were successfully processed by awk and the next three lines in your input file. Also, please show us the output you get from gawk for those...
13,415
Posted By vgersh99
Are you using awk's native lshift/rshift/or...
Are you using awk's native lshift/rshift/or functions OR did you provide your own implementations (as previously discussed)?
Are there any other ip ranges with the 128.x.x.x addresses that don't...
13,415
Posted By vgersh99
congrats. If you paid attention to the thread,...
congrats.
If you paid attention to the thread, I've been testing the latest version of the script with data files either

1.62.189.215 1.62.189.222
4.0.25.146 4.0.25.148
4.0.26.14 4.0.29.24...
13,415
Posted By vgersh99
You're right - the FS definitions are not the...
You're right - the FS definitions are not the same - I've overlooked something in your definition.
If you are to handle 2 possible formats:

address ranges separated by - ( dash surrounded by...
13,415
Posted By vgersh99
Good catch - thanks for the perseverance! how...
Good catch - thanks for the perseverance!
how about:

function range2cidr(ipStart, ipEnd, result, bits, mask, newip) {
bits = 1
mask = 1
while (bits < 32) {
newip =...
13,415
Posted By vgersh99
sorry, these 2 lines should read: !/^#/ &&...
sorry, these 2 lines should read:

!/^#/ && NF {$(NF-1)= sanitize($(NF-1)); $NF = sanitize($NF)}

!/^#/ && NF {print range2cidr(ip2dec($(NF-1)), ip2dec($NF))}

Let me know how it goes...
...
13,415
Posted By vgersh99
you can get rid of all the grep-s/sed-s and pipe...
you can get rid of all the grep-s/sed-s and pipe it directly into the modified script (without any temp file).
Good luck.
13,415
Posted By Corona688
mawk is indeed designed for speed above all else....
mawk is indeed designed for speed above all else. Occasionally its features are lacking but that can usually be worked around.
13,415
Posted By vgersh99
Looks like an old branch of gawk with non-POSIX...
Looks like an old branch of gawk with non-POSIX extensions.
Probably a buggy and/or not so forgiving as gawk...
The BUGS section at the bottom of the man page might give some hints of what can be...
34,793
Posted By ripat
Convert ip ranges to CIDR netblocks
Hi,

Recently I had to convert a 280K lines of ip ranges to the CIDR notation and generate a file to be used by ipset (netfilter) for ip filtering.

Input file:
000.000.000.000 -...
13,415
Posted By vgersh99
are you sure you're getting the desired results? ...
are you sure you're getting the desired results?
I'm getting:

222.104.193.5/32
222.106.31.112/32
222.106.31.123/32
222.126.13.224/32
222.191.251.186/32

on your sample/modified file:
...
13,415
Posted By Corona688
Did you search here first? ...
Did you search here first?

https://www.unix.com/shell-programming-and-scripting/233825-convert-ip-ranges-cidr-netblocks.html
13,415
Posted By vgersh99
This thread is a treasure - stealing. Thanks...
This thread is a treasure - stealing.
Thanks for sharing
13,415
Posted By vgersh99
Post #2 in the thread contained the written or()...
Post #2 in the thread contained the written or() lshift() and rshift() functions if they're missing in the version of awk you're using.
13,415
Posted By Corona688
Why do you have #!/bin/sh at the beginning of awk...
Why do you have #!/bin/sh at the beginning of awk code? It doesn't belong there. Hopefully it's doing nothing right now.

awk -f command inputfile > filename
2,811
Posted By Neo
This is not how web developers process the DOM in...
This is not how web developers process the DOM in HTML, especially on the client side.

Should I assume you are processing the value on the server side?

Either way, your post confused me. On...
2,811
Posted By Corona688
You can try my awk XML processor...
You can try my awk XML processor (https://www.unix.com/unix-for-beginners-questions-and-answers/266171-general-purpose-xml-processing.html).

awk -f yanx.awk -e 'TAG == "INPUT" &&...
2,811
Posted By Corona688
Had you tried my earlier suggestion, it worked. ...
Had you tried my earlier suggestion, it worked. With one correction -- the HTML you posted was wrong, the tag is not named 'token', it is named 'sessionKey'.

So my final code:

$ awk -f...
21,021
Posted By Scrutinizer
How about: sed...
How about:
sed '/SECTION2-BEGIN/,/SECTION2-END/s/]/]]]/g' infile
21,021
Posted By balajesuri
perl -pe...
perl -pe 'if(/SECTION2-BEGIN/../SECTION2-END/){s/\]/]]]/g}' file
Showing results 1 to 22 of 22

 
All times are GMT -4. The time now is 10:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy