lab3

parent b14f4bb2
#!/bin/bash
grep -roE ' [0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} ' $1 > temp
awk -F"." '{num= $1;
if ($2 <= 255 && $3 <= 255 && $4 <= 255)
{
if (num < 128)
print $0 " A";
else if (num < 192)
print $0 " B";
else if (num < 224)
print $0 " C";
else if (num < 240)
print $0 " D";
else if(num < 248 )
print $0 " E";
else if(num <= 255)
print $0 " Not Defined" ;}}' temp
rm temp
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment