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

du(1) completion and a little $RANDOM problem



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.

Here is what I mean, against zsh-4.1.1.

--- Completion/Unix/Type/_directories.old
+++ Completion/Unix/Type/_directories
@@ -1,4 +1,4 @@
-#compdef rmdir df du dircmp -P -value-,*path,-default-
+#compdef rmdir df dircmp -P -value-,*path,-default-
 
 local expl
 

Another problem I have deals with $RANDOM. Using echo $RANDOM works as
expected, a new random value is printed each time.

[g ~]$ echo $RANDOM
29407
[g ~]$ echo $RANDOM
31292
[g ~]$ echo $RANDOM
11843
[g ~]$ echo $RANDOM
22883
[g ~]$ echo $RANDOM
20814

But if I do echo `echo $RANDOM` then the random value is always the same.

[g ~]$ echo `echo $RANDOM`
6853
[g ~]$ echo `echo $RANDOM`
6853
[g ~]$ echo `echo $RANDOM`
6853
[g ~]$ echo `echo $RANDOM`
6853
[g ~]$ echo `echo $RANDOM`
6853


And the behaviour is the same if zsh is called as sh.

Thanks
Guillaume








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