Years ago iwconfig started its life in /sbin. Then some distributions
moved it to /usr/bin. Then in 2012 some projects started pushing for
deprecation of /usr/sbin and merging everything into /usr/bin.
We now search paths including /usr/bin for the iwconfig binary. This
is because sbin paths are not usually in non privileged user PATH, so
we help io.popen locate the binary on the file-system.
We do this search in the following way:
- default to basename only, 'iwconfig' for the iwconfig variable
- search paths one by one once and redeclare variable iwconfig with
full path if binary is found in any
- avoid searching paths on next execution if iwconfig variable
already contains a path