[Toybox] Thinking about fuser.

Rob Landley rob at landley.net
Thu May 10 08:06:03 PDT 2018


I haven't implemented fuser because the way it works is kinda stupid. And
inconsistent with how things like "grep" work.

I'm pondering doing an fuser that works like grep, as in all the output goes to
stdout when there isn't an error, but if you give it one file it doesn't prefix
it with filename: and if you give it multiple files it does by default but
there's an option to switch it off.

BUT: that's not how the existing fuser works. The _lack_ of a command isn't
explicitly nonconformant, this would be. But what this would be is _consistent_,
working the same way other commands work.

Unsure whether or not I should do that. Any opinions? (If you have a script
doing "fuser onefile 2>/dev/null" both would work the same way, but if your
script is doing "fuser file file file" it wouldn't. You'd have to add.. what's
the grep option... -h. You'd have to change your script to say "fuser -h one two
three".)

I suppose what I could do is have a --posix and then you can alias fuser "fuser
--posix" in your /etc/profile and then if you really need the old behavior...?

(This isn't like cut -DF because you have to explicitly add those flags to get
the different behavior. That extends the spec rather than violating it.)

Rob



More information about the Toybox mailing list