On January 5, 2006 09:39 am, Andrew Porter wrote: > On Fri, 2006-01-06 at 00:59 +1100, John O'Hagan wrote: > > On Wed, 4 Jan 2006 02:26 am, Johannes Zarl wrote: > > In the end I used gawk with ":" as a field > > separator to extract them: > > > > networks=$(iwlist eth1 scan | grep ESSID | gawk -F: '{ print $2 }') > > This can be optimised to - > > networks=$(iwlist eth1 scan | gawk -F: '/ESSID/ { print $2 }') Prehaps would should use a: INTERFACE=eth1 networks=$(iwlist $INTERFACE scan | gawk -F: '/ESSID/ { print $2 }') So people can easily change the interface.
Attachment:
pgpTsBw6_FOC1.pgp
Description: PGP signature