Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: du(1) completion and a little $RANDOM problem
- X-seq: zsh-workers 18861
- From: Peter Stephenson <pws@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: du(1) completion and a little $RANDOM problem
- Date: Wed, 16 Jul 2003 12:30:09 +0100
- In-reply-to: "Guillaume Chazarain"'s message of "Wed, 16 Jul 2003 13:16:31 +0200." <WMLXW933VXMGWU3V62QML52GE5YB7.3f15340f@monpc>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Guillaume Chazarain wrote:
> Hi list,
>
> Zsh's default completion on the du(1) command is to show only the
> directories, but why? since du can also be used on files.
It probably deserves it's own completion. Note if you have GNU du you
can:
compdef _gnu_generic du
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?)
> But if I do echo `echo $RANDOM` then the random value is always the same.
This is documented in the manual entry.
RANDOM <S>
A pseudo-random integer from 0 to 32767, newly gen-
erated each time this parameter is referenced. The
random number generator can be seeded by assigning a
numeric value to RANDOM.
The values of RANDOM form an intentionally-repeatable
pseudo-random sequence; subshells that reference RANDOM
will result in identical pseudo-random values unless
the value of RANDOM is referenced or seeded in the
parent shell in between subshell invocations.
The workaround is to refer to it in the current shell between
invocations. The only other fix would be some communication with the
subshell.
--
Peter Stephenson <pws@xxxxxxx> Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK Tel: +44 (0)1223 692070
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
Messages sorted by:
Reverse Date,
Date,
Thread,
Author