Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: du(1) completion and a little $RANDOM problem

Bart wrote:
> On Jul 16, 12:30pm, Peter Stephenson wrote:
> } 
> } for best results.  (I wonder if we could autodetect or at least guess
> } some of these at startup where guessing wrong isn't too painful?)
> Sven, Oliver and I have had several threads about this dating back a
> very long time -- see for example zsh-workers/10998.

That discussion resulted in _pick_variant. You need to be fairly
confident that running the command in question to see what it is is
safe and quick though.

I'd have thought it would be safe for du as it doesn't have any
destructive modes of operation that I'm aware of. On Solaris 8, du
--version produces:

  du: illegal option -- -
  usage: du [-a][-d][-k][-r][-o|-s][-L] [file ...]

I don't have access to any other systems to see what they do. The trick
used by _finger to see what options are available is quite nice.
Otherwise the best way to determine what options are available tends to
be a big case statement checking $OSTYPE (after using _pick_variant to
check for GNU).


This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit

Messages sorted by: Reverse Date, Date, Thread, Author