Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Print a message and exit if file was not found.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Fri, 30 Nov 2012 14:59:14 +0000 (15:59 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 3 Dec 2012 10:12:38 +0000 (11:12 +0100)
src/smpi/smpirun.in

index cb94bd6..bdede7a 100755 (executable)
@@ -236,9 +236,12 @@ fi
 
 if [ "${EXTOPT}" = "smpi_replay" ]; then
   APP_TRACES=$1;
-  if [ -n "${APP_TRACES}" ] && [ -f ${APP_TRACES} ]; then
+  if [ -n "${APP_TRACES}" ] && [ -f "${APP_TRACES}" ]; then
      hosttraces=(`cat ${APP_TRACES} | tr \\\n " "`)
      NUMTRACES=`cat ${APP_TRACES} | wc -l`
+  else
+     printf "File not found: %s\n", "${APP_TRACES:-\${APP_TRACES}}" >&2
+     exit 1
   fi
 fi