Re: BUG or OPERATOR error? - was [Re: Measuring aggregate internet useage?]
On Mon 01 May 2017 at 14:48:13 (-0400), Greg Wooledge wrote:
> On Mon, May 01, 2017 at 01:18:58PM -0500, David Wright wrote:
> > They do. Both expect a command. You can "show" something but you can't
> > "dev" it or, at least, I don't know how to.
> The surprise comes from the fact that typically you can add "dev eth0"
> to the end of one working ip command, to get another working ip command
> which is restricted to that one interface -- but not always.
> ip addr show (working)
> ip addr show dev eth0 (working)
> ip addr (working)
> ip addr dev eth0 (NOT working)
> ip -s link show (working)
> ip -s link show dev eth0 (working)
> ip -s link (working)
> ip -s link dev eth0 (NOT working)
> Apparently, in order to understand why half of the commands work and
> half do not, you have to somehow figure out that you're currently using
> a command with an assumed verb, and that this makes a difference, in
> some way, if you try to add words that follow the assumed verb. Like,
> "the verb is only added if the parser runs out of words" or something.
I'd assumed that the presumption of "show [everything]" was there
because non-root users can do little else, and I don't think you can
omit/assume any other verb. cf mount.
> The inconsistency is quite confusing, especially if you haven't
> scientifically attempted EVERY combination of words yet, to see which
> combinations work and which do not, in order to analyze it for patterns
> and infer the actual grammar rules.
Sure, but who would prefer "ip link" to give you a load of its BNF
rather than assuming you meant show. "ip" does give you BNF, it's
true, but with such a flexible command, where to start. "ip nt"
already fills the screen; only 16 more object types to go.