From: Frank Terbeck Date: Mon, 28 Nov 2011 21:19:31 +0000 (+0100) Subject: zshrc: Move exirename to its own file X-Git-Tag: v0.5.0~81 X-Git-Url: https://git.grml.org/?p=grml-etc-core.git;a=commitdiff_plain;h=9eb3cd4d6ca814376a551ddea2e8905946813301 zshrc: Move exirename to its own file Signed-off-by: Frank Terbeck --- diff --git a/etc/zsh/zshrc b/etc/zsh/zshrc index 22b3195..7311a22 100644 --- a/etc/zsh/zshrc +++ b/etc/zsh/zshrc @@ -3424,25 +3424,6 @@ smart-indent() { check_com -c histring && \ alias hidiff="histring -fE '^Comparing files .*|^diff .*' | histring -c yellow -fE '^\-.*' | histring -c green -fE '^\+.*'" -# rename pictures based on information found in exif headers -#f5# Rename pictures based on information found in exif headers -exirename() { - emulate -L zsh - if [[ $# -lt 1 ]] ; then - echo 'Usage: jpgrename $FILES' >& 2 - return 1 - else - echo -n 'Checking for jhead with version newer than 1.9: ' - jhead_version=`jhead -h | grep 'used by most Digital Cameras. v.*' | awk '{print $6}' | tr -d v` - if [[ $jhead_version > '1.9' ]]; then - echo 'success - now running jhead.' - jhead -n%Y-%m-%d_%Hh%M_%f $* - else - echo 'failed - exiting.' - fi - fi -} - #f5# Change the xterm title from within GNU-screen xtrename() { emulate -L zsh diff --git a/usr_share_grml/zsh/functions/exirename b/usr_share_grml/zsh/functions/exirename new file mode 100644 index 0000000..2ab3b62 --- /dev/null +++ b/usr_share_grml/zsh/functions/exirename @@ -0,0 +1,18 @@ +# Rename pictures based on information found in exif headers +emulate -L zsh + +if [[ $# -lt 1 ]] ; then + echo 'Usage: jpgrename $FILES' >& 2 + return 1 +else + echo -n 'Checking for jhead with version newer than 1.9: ' + jhead_version=`jhead -h | \ + grep 'used by most Digital Cameras. v.*' | \ + awk '{print $6}' | tr -d v` + if [[ $jhead_version > '1.9' ]]; then + echo 'success - now running jhead.' + jhead -n%Y-%m-%d_%Hh%M_%f $* + else + echo 'failed - exiting.' + fi +fi