On Sun, Jan 28, 2018 at 09:09:42PM +0000, Stuart Henderson wrote:
> On 2018/01/28 21:34, bijan wrote:
> > On 01/28/18 21:24, bijan wrote:
> > > Hi,
> > > 
> > > Added -l argument to ifconfig to only print names of interfaces.
> > > (Maybe a lame excuse from me for being too lazy but FreeBSD
> > > supports it too)
> > Missed the usage string, Update!
> 
> Pretty sure this diff has been rejected once or twice before.
> 
> This is what the installer does,
> 
> ifconfig | sed -n 's/^\([^[:space:]]*\):.*/\1/p'
Seems overly complicated to me, interface names are the only lines in
ifconfig without leading whitespaces and must begin with a lowercase
letter.

How about this? Exact same output.

Index: distrib/miniroot/install.sub
===================================================================
RCS file: /cvs/src/distrib/miniroot/install.sub,v
retrieving revision 1.1056
diff -u -p -r1.1056 install.sub
--- distrib/miniroot/install.sub        21 Jan 2018 19:58:37 -0000      1.1056
+++ distrib/miniroot/install.sub        28 Jan 2018 22:39:19 -0000
@@ -330,7 +330,7 @@ get_ifs() {
        local _if _iflist=$(rmel vlan $(ifconfig -C))
 
        for _if in $(ifconfig "$@" 2>/dev/null |
-               sed -n 's/^\([^[:space:]]*\):.*/\1/p'); do
+               sed -n '/^[a-z]/s,:.*,,p'); do
                isin "${_if%%+([0-9])}" $_iflist || echo $_if
        done
 }

Reply via email to