From cdf066ac3e9b2526f6b8f1377c6c96067fdc2527 Mon Sep 17 00:00:00 2001 From: bouilhol Date: Wed, 19 Jan 2011 20:47:09 +0000 Subject: [PATCH] Abort if no phase found --- vv/scripts/create_mhd_4D.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/vv/scripts/create_mhd_4D.sh b/vv/scripts/create_mhd_4D.sh index 6b27212..962541d 100755 --- a/vv/scripts/create_mhd_4D.sh +++ b/vv/scripts/create_mhd_4D.sh @@ -1,16 +1,22 @@ #!/bin/sh + ##################################################################### # create_mhd_4D argument : repertoire nom_fichier_de_sortie # ##################################################################### if [ $# -lt 1 ] then - echo "Usage: create_mhd_4D directory output_file_name" + echo "Usage: create_mhd_4D.sh directory output_file_name" exit 1 fi cd $1 -nbph=`ls -l *0.mhd | wc -l` +nbph=`find -iname *0.mhd | wc -l` +if [ $nbph = 0 ] +then + echo "Error: no phase found" + exit 1 +fi orig=`ls -1 *0.mhd | head -n 1` cat $orig | sed "s/NDims = .*/NDims = 4/ -- 2.47.1