Mercurial > hg > foxridge-archiver
changeset 34:51d136834761
added error message for empty list file
author | casties |
---|---|
date | Fri, 23 Jun 2006 10:57:56 +0200 |
parents | 9868f6ed9a54 |
children | e27d097a9d87 |
files | unarchivemany.sh |
diffstat | 1 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/unarchivemany.sh Tue Jun 20 18:23:26 2006 +0200 +++ b/unarchivemany.sh Fri Jun 23 10:57:56 2006 +0200 @@ -1,12 +1,12 @@ #!/bin/bash -VERSION="unarchivemany V0.1 (14.6.2005 ROC)" +VERSION="unarchivemany V0.2 (23.6.2006 ROC)" if [ -z "$1$2" ] then echo $VERSION echo "use: $0 docdir dirlist" - echo " Unrchives the directories given in the file dirlist inside docdir." + echo " Unarchives the directories given in the file dirlist inside docdir." exit 1 fi @@ -25,11 +25,14 @@ exit 1 fi +CNT=0 + cat $DIRLIST | while read DIR do + CNT=$(( $CNT + 1 )) if [ -d "$BASEDIR/$DIR" ] then - echo "unarchiving $DIR..." + echo "$CNT: unarchiving $DIR..." if /usr/local/mpiwg/archive/unarchiver "$BASEDIR/$DIR" then echo " done on `date`" @@ -38,6 +41,11 @@ # abort? fi else - echo "ERROR: document directory $BASEDIR/$DIR not found!" + echo "$CNT: ERROR: document directory $BASEDIR/$DIR not found!" fi done + +if [ $CNT = 0 ] +then + echo "ERROR: the list file $DIRLIST seems to be empty!" +fi