Apply patch by Christian Schneider 0.7.1
authorMichael Prokop <mika@grml.org>
Sat, 27 Oct 2007 23:32:27 +0000 (01:32 +0200)
committerMichael Prokop <mika@grml.org>
Sat, 27 Oct 2007 23:32:27 +0000 (01:32 +0200)
debian/changelog
zsh-lovers.1.txt

index b7e24cd..479a990 100644 (file)
@@ -1,3 +1,10 @@
+zsh-lovers (0.7.1) unstable; urgency=low
+
+  * Apply patch by Christian Schneider providing some further
+    examples, thanks!
+
+ -- Michael Prokop <mika@grml.org>  Sun, 28 Oct 2007 01:31:51 +0200
+
 zsh-lovers (0.7.0) unstable; urgency=low
 
   * Better example for 'Show me all the .c files for which
 zsh-lovers (0.7.0) unstable; urgency=low
 
   * Better example for 'Show me all the .c files for which
index 7394eee..a7e3f79 100644 (file)
@@ -210,6 +210,21 @@ Hint: A list of valid glob Qualifiers can be found in zshexpn(1).
 See ``man 1 zshexpn | less -p'' Qualifiers for details.
 
 -------------------------------------------------------------------------------
 See ``man 1 zshexpn | less -p'' Qualifiers for details.
 
 -------------------------------------------------------------------------------
+# random numbers
+  $ echo $[${RANDOM}%1000]     # random between 0-999
+  $ echo $[${RANDOM}%11+10]    # random between 10-20
+  $ echo ${(l:3::0:)${RANDOM}} # N digits long (3 digits)
+
+# reverse a word
+  $ echo "${(j::)${(@Oa)${(s::):-hello}}}"
+
+# Show newest directory
+  $ ls -ld *(/om[1])
+
+# random array element
+  $ FILES=( .../files/* )
+  $ feh $FILES[$RANDOM%$#FILES+1]
+
 # cat first line in all files in this dir
   $ for file (*(ND-.)) IFS= read -re < $file
 
 # cat first line in all files in this dir
   $ for file (*(ND-.)) IFS= read -re < $file
 
@@ -829,6 +844,10 @@ ZMV-Examples (require autoload zmv)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *Note:* '-n' means no execution (just print what would happen). At
 -------------------------------------------------------------------------------
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *Note:* '-n' means no execution (just print what would happen). At
 -------------------------------------------------------------------------------
+# remove round bracket within filenames
+# i. e. foo-(bar).avi -> foo-bar.avi
+  $ zmv '*' '${f//[()]/}'
+
 # serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)
   $ autoload zmv
   $ ls *
 # serially all files (foo.foo > 1.foo, fnord.foo > 2.foo, ..)
   $ autoload zmv
   $ ls *