changeset 36:9eb746dc69f8

while read loop works now!
author casties
date Fri, 23 Jun 2006 11:49:06 +0200
parents e27d097a9d87
children 1afdf186b65e
files unarchivemany.sh
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/unarchivemany.sh	Fri Jun 23 11:40:12 2006 +0200
+++ b/unarchivemany.sh	Fri Jun 23 11:49:06 2006 +0200
@@ -27,7 +27,8 @@
 
 CNT=0
 
-cat  $DIRLIST | while read DIR
+# read directories from DIRLIST
+while read DIR
 do
     CNT=$(( $CNT + 1 ))
     if [ -d "$BASEDIR/$DIR" ]
@@ -43,9 +44,9 @@
     else
 	echo "$CNT: ERROR: document directory $BASEDIR/$DIR not found!"
     fi
-done
+done < $DIRLIST
 
-#if [ $CNT = "0" ]
-#then
-#    echo "$CNT ERROR: the list file $DIRLIST seems to be empty!"
-#fi
+if [ $CNT = 0 ]
+then
+    echo "$CNT ERROR: the list file $DIRLIST seems to be empty!"
+fi