Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines with new year.
[simgrid.git] / examples / smpi / replay_multiple / generate_multiple_deployment.sh
index c1272ab..5de54b4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env sh
 
-# Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.
+# Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.
 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the license (GNU LGPL) which comes with this package.
@@ -124,7 +124,7 @@ DESCRIPTIONFILE=$(echo $PROC_ARGS|cut -d' ' -f1)
 
 if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
     IFS_OLD=$IFS
-    IFS=$'\n'
+    IFS=$(printf '\n_'); IFS=${IFS%_} # protect trailing \n
     set -f
     NUMPROCS=0
     while IFS= read -r line; do
@@ -149,7 +149,7 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
             SEQ1=$( ${HAVE_SEQ} 0 $(( NUMPROCSMINE - 1 )) )
         else
             cnt=0
-            while (( cnt < NUMPROCSMINE )) ; do
+            while [ $(( cnt < NUMPROCSMINE )) -ne 0 ]; do
                 SEQ1="$SEQ1 $cnt"
                 cnt=$((cnt + 1))
             done
@@ -186,7 +186,7 @@ if [ -n "${DESCRIPTIONFILE}" ] && [ -f "${DESCRIPTIONFILE}" ]; then
         done
         # return IFS back to newline for "for" loop
         IFS_OLD=$IFS
-        IFS=$'\n'
+        IFS=$(printf '\n_'); IFS=${IFS%_} # protect trailing \n
     done < ${DESCRIPTIONFILE}
 
     # return delimiter to previous value