[ale] scripting challenge du'jour

Brian J. Dowd bdowd at dentfirst.com
Wed Jul 5 20:47:20 EDT 2006


/sbin/ifconfig | grep inet\  | sed -e 's/:/\ /g' | sed -e '/127.0.0.1/d' 
| awk -F\  '{print $3"/"$7"\t\t"$5}'
(removed the "- " at the beginning on the second line...)
Nice! Job!
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 07/05/06 19:19, Jim Popovitch published:
>   
>> What's the fastest, cleanest, most optimized, shell script (non perl, 
>> etc) method to take the output of ifconfig and produce a list that 
>> resembles this:
>>
>> 192.168.4.5/255.255.255.0	192.168.4.255
>> 172.16.8.12/255.255.0.0		172.16.255.255
>>
>>
>> Go!
>>
>> -Jim P.  (TIA ;-))
>>     
>
> ifconfig | grep inet\  | sed -e 's/:/\ /g' | sed -e '/127.0.0.1/d' | awk
> - -F\  '{print $3"/"$7"\t\t"$5}'
>
> That was fun.  ;)
>
> - --
>
> Richard Kolkovich
> sarumont at sigil.org
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.3 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFErFlDfXtD1KVAIbARAmJQAJ9byKXisQihmAs6fiE+JdepxpfZdgCgjUXs
> Z+XPzeOKMUxoUo6LjLi8dUA=
> =H4Qo
> -----END PGP SIGNATURE-----
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale
>
>   




More information about the Ale mailing list