[ale] scripting challenge du'jour

Richard Kolkovich sarumont at sigil.org
Wed Jul 5 20:28:51 EDT 2006


-----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-----



More information about the Ale mailing list