Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 May 2020 11:39:08 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Eugene Grosbein <eugen@grosbein.net>, Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: Introduce ifconfig -a -g groupname
Message-ID:  <1bb658e41c849e9ea2c623ffdc70b0b934d4053d.camel@freebsd.org>
In-Reply-To: <f2590459-6207-32c2-ca0e-212c1f4f0765@grosbein.net>
References:  <f2590459-6207-32c2-ca0e-212c1f4f0765@grosbein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2020-05-29 at 19:57 +0700, Eugene Grosbein wrote:
> Hi!
> 
> Currently "ifconfig -a" command that shows status of network
> interfaces
> may be combined with flags -d or -u to limit the list to interfaces
> that are down or up.
> 
> The change https://reviews.freebsd.org/D25029 allows it to filter the
> list
> by name of interface group with additional flag -g groupname, or -g
> ^groupname to negate condition
> (this is different from "ifconfig -g groupname" that shows interface
> names only
> and that behaviour is not affected with the change).
> 
> I chose caret symbol (^) was choosen to ease both scripted and
> interactive usage
> so it does not require extra quotation/escaping, but was told
> that caret would require escaping in the zsh.
> 
> So I ask for suggestions which symbol to choose instead of caret.
> Benedict Reuschling suggested @ and I'm fine with it
> if we don't care about Perl code that would require escaping it when
> running shell code.
> 
> For thouse who interested, these are supposed usage examples:
> 
> to exclude loopback from the list:
> 	ifconfig -a -g ^lo
> to show vlan interfaces only:
> 	ifconfig -a -g vlan
> to show tap interfaces that are up:
> 	ifconfig -aug tap
> 

An @ to express negation is insane.  The only characters that have some
precedent for meaning negation are ~ and !.

Escaping is a fact of life, asking people to remember crazy things like
@ meaning not is far more onerous than occasionally needing to put
quotes or escapes on something.

-- Ian




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1bb658e41c849e9ea2c623ffdc70b0b934d4053d.camel>