From 2bf79bbb247c6c349ae697abfd2a3fdca1f2681a Mon Sep 17 00:00:00 2001 From: Carsten Hey Date: Mon, 28 Jun 2010 14:03:42 +0200 Subject: [PATCH] zshrc: rename new() to modified(), add an alias for backwards compatibility and add new function accessed() Signed-off-by: Carsten Hey --- doc/grmlzshrc.t2t | 7 ++++++- etc/zsh/zshrc | 10 +++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/grmlzshrc.t2t b/doc/grmlzshrc.t2t index 1878148..607d3f4 100644 --- a/doc/grmlzshrc.t2t +++ b/doc/grmlzshrc.t2t @@ -415,6 +415,11 @@ Converts plaintext files to HTML using vim. The output is written to If 915resolution is available, issues a warning to the user to run it instead to modify the resolution on intel graphics chipsets. +: **accessed()** +Lists files in current directory, which have been accessed within the +last N days. N is an integer to be passed as first and only argument. +If no argument is specified N is set to 1. + : **agoogle()** Searches for USENET postings from authors using google groups. @@ -660,7 +665,7 @@ Creates a directory with first parameter as name inside $MAILDIR_ROOT Runs "make install" and logs the output under ~/.errorlogs/; useful for a clean deinstall later. -: **new()** +: **modified()** Lists files in current directory, which have been modified within the last N days. N is an integer to be passed as first and only argument. If no argument is specified N is set to 1. diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 3f53ec3..b29bc37 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3514,6 +3514,12 @@ regcheck() { pcre_match $2 && echo "regex matches" || echo "regex does not match" } +#f5# List files which have been accessed within the last {\it n} days, {\it n} defaults to 1 +accessed() { + emulate -L zsh + print -l *(a-${1:-1}) +} + #f5# List files which have been changed within the last {\it n} days, {\it n} defaults to 1 changed() { emulate -L zsh @@ -3521,10 +3527,12 @@ changed() { } #f5# List files which have been modified within the last {\it n} days, {\it n} defaults to 1 -new() { +modified() { emulate -L zsh print -l *(m-${1:-1}) } +# modified() was named new() in earlier versions, add an alias for backwards compatibility +which new >/dev/null || alias new=modified #f5# Grep in history greph() { -- 2.1.4