From ae87b2c4cad3a18968d32dbfcfff2efa2741eba2 Mon Sep 17 00:00:00 2001
From: Mark Jenkinson <mark@fmrib.ox.ac.uk>
Date: Thu, 30 Sep 2004 07:05:24 +0000
Subject: [PATCH] Now ignores tabs as well as spaces

---
 bedpost_datacheck | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bedpost_datacheck b/bedpost_datacheck
index dbefdb4..2460423 100755
--- a/bedpost_datacheck
+++ b/bedpost_datacheck
@@ -1,8 +1,8 @@
 #!/bin/sh
 
-if [ "$1" = "" ]; then 
+if [ $# -lt 1 ]; then 
     echo "Usage: $0 data_dir"
-    exit;
+    exit 1;
 fi
 
 DIR=$1;
@@ -18,7 +18,7 @@ done
 
 for bv in ${DIR}/bvals ${DIR}/bvecs;do
     echo " num lines in $bv "
-    cat $bv |grep -v "^ *$"|wc -l
+    cat $bv |grep -v "^[ 	]*$"|wc -l
     echo " num words in $bv "
     cat $bv|wc -w
 done
@@ -39,9 +39,9 @@ if [ `${FSLDIR}/bin/imtest ${DIR}/data` -eq 1 -a `${FSLDIR}/bin/imtest ${DIR}/no
 	echo "data dimensions do not match mask dimensions"
     fi
     
-    bvallen=`cat ${DIR}/bvals|grep -v "^ *$"|wc -w`
+    bvallen=`cat ${DIR}/bvals|grep -v "^[ 	]*$"|wc -w`
     bveclenw=`cat ${DIR}/bvecs|wc -w`
-    bveclenl=`cat ${DIR}/bvecs|grep -v "^ *$"|wc -l`
+    bveclenl=`cat ${DIR}/bvecs|grep -v "^[ 	]*$"|wc -l`
     bveclen=`echo "$bveclenw / $bveclenl"|bc`
 
     
@@ -55,4 +55,4 @@ if [ `${FSLDIR}/bin/imtest ${DIR}/data` -eq 1 -a `${FSLDIR}/bin/imtest ${DIR}/no
 	echo "number of elements per line in bvecs is not equal to number of vols in data"
     fi
 	
-fi
\ No newline at end of file
+fi
-- 
GitLab