[cdftools] 58/228: JMM modified version of mkordre for MEAN directory
Alastair McKinstry
mckinstry at moszumanska.debian.org
Fri Jun 12 08:21:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch master
in repository cdftools.
commit 0ac0d2ed6a4a799aa7c29a651acf9e7ead629ce0
Author: molines <molines at 1055176f-818a-41d9-83e1-73fbe5b947c5>
Date: Wed Jun 16 10:07:56 2010 +0000
JMM modified version of mkordre for MEAN directory
git-svn-id: http://servforge.legi.grenoble-inp.fr/svn/CDFTOOLS/trunk@334 1055176f-818a-41d9-83e1-73fbe5b947c5
---
JOBS/mkordremean | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/JOBS/mkordremean b/JOBS/mkordremean
new file mode 100755
index 0000000..773d059
--- /dev/null
+++ b/JOBS/mkordremean
@@ -0,0 +1,32 @@
+#!/bin/ksh
+#set -xv
+# Shell functions
+# check existence and eventually create directory
+chkdir() { if [ ! -d $1 ] ; then mkdir $1 ; fi ; }
+
+# Checck if the current dir is a xxx-xx-S directory
+here=$(basename $( pwd ) )
+ext=$( echo $here | sed -e 's/-/ /g' | awk '{print $3}' )
+
+if [ ${ext:-none} != 'MEAN' ] ; then
+ echo 'you are not in an -MEAN directory. You cannot mkordre :('
+ exit 1
+fi
+
+# Move annex tarfiles to ANNEX
+ls *anne* 2> /dev/null && { chkdir ANNEX ; mv *anne* ANNEX ; }
+
+# Scan the different types of files and send then to the YEAR directory
+for type in gridT gridU gridV gridW icemod ptrcT; do
+ ls *${type}.nc 2> /dev/null && { \
+ for f in *_${type}.nc ; do
+ tag=$( echo $f | sed -e 's/_/ /g' | awk '{print $2}' )
+ year=$( echo $tag | sed -e's/m/ /' | awk '{print $1}' | tr -d 'y' )
+
+ chkdir $year
+ mv $f $year
+ done ; }
+done
+
+
+
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cdftools.git
More information about the debian-science-commits
mailing list