Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Shell scripts: replace backquotes with $().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 27 Jul 2017 07:26:54 +0000 (09:26 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 27 Jul 2017 11:54:52 +0000 (13:54 +0200)
src/smpi/smpirun.in
teshsuite/smpi/mpich3-test/generate_report
tools/git-hooks/clang-format.pre-commit

index a8c75e1..8889a00 100755 (executable)
@@ -298,7 +298,7 @@ fi
 UNROLLEDHOSTFILETMP=0
 
 #parse if our lines are terminated by :num_process
 UNROLLEDHOSTFILETMP=0
 
 #parse if our lines are terminated by :num_process
-multiple_processes=`grep -c ":" $HOSTFILE`
+multiple_processes=$(grep -c ":" $HOSTFILE)
 if [ "${multiple_processes}" -gt 0 ] ; then
     UNROLLEDHOSTFILETMP=1
     UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
 if [ "${multiple_processes}" -gt 0 ] ; then
     UNROLLEDHOSTFILETMP=1
     UNROLLEDHOSTFILE="$(mktemp smpitmp-hostfXXXXXX)"
@@ -311,7 +311,7 @@ if [ "${multiple_processes}" -gt 0 ] ; then
 fi
 
 # Don't use wc -l to compute it to avoid issues with trailing \n at EOF
 fi
 
 # Don't use wc -l to compute it to avoid issues with trailing \n at EOF
-hostfile_procs=`grep -c "[a-zA-Z0-9]" $HOSTFILE`
+hostfile_procs=$(grep -c "[a-zA-Z0-9]" $HOSTFILE)
 if [ ${hostfile_procs} = 0 ] ; then
    echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2
    exit 1
 if [ ${hostfile_procs} = 0 ] ; then
    echo "[`basename $0`] ** error: the hostfile '${HOSTFILE}' is empty. Aborting." >&2
    exit 1
@@ -401,10 +401,10 @@ fi
 ##  hostfile has less than i lines.
 ##----------------------------------------------------------
 
 ##  hostfile has less than i lines.
 ##----------------------------------------------------------
 
-HAVE_SEQ="`which seq 2>/dev/null`"
+HAVE_SEQ="$(which seq 2>/dev/null)"
 
 if [ -n "${HAVE_SEQ}" ]; then
 
 if [ -n "${HAVE_SEQ}" ]; then
-    SEQ=`${HAVE_SEQ} 0 $((${NUMPROCS}-1))`
+    SEQ=$(${HAVE_SEQ} 0 $((${NUMPROCS}-1)))
 else
     cnt=0
     while [ $cnt -lt ${NUMPROCS} ] ; do
 else
     cnt=0
     while [ $cnt -lt ${NUMPROCS} ] ; do
index ac33562..1b3c55e 100755 (executable)
@@ -2,8 +2,8 @@
 
 explore_files() {
 
 
 explore_files() {
 
-  for cmake in `find -name CMakeLists.txt` ; do
-    d=`dirname $cmake`
+  for cmake in $(find -name CMakeLists.txt) ; do
+    d=$(dirname $cmake)
   
     echo;echo "Directory $d"
   
   
     echo;echo "Directory $d"
   
index db2e47a..8d1bd55 100755 (executable)
@@ -43,7 +43,7 @@ CLANG_FORMAT=$(which clang-format-3.8)
 for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do
  where=$(which $name)
  if [ x != "x$where" ] ; then
 for name in git-clang-format-3.9 git-clang-format-3.8 git-clang-format ; do
  where=$(which $name)
  if [ x != "x$where" ] ; then
-   GIT_SUBCOMMAND=`echo $name|sed 's/git-//'`
+   GIT_SUBCOMMAND=$(echo $name|sed 's/git-//')
    break
  fi
 done
    break
  fi
 done
@@ -74,10 +74,10 @@ canonicalize_filename () {
     local result=""
 
     # Need to restore the working directory after work.
     local result=""
 
     # Need to restore the working directory after work.
-    pushd `pwd` > /dev/null
+    pushd $(pwd) > /dev/null
 
     cd "$(dirname "$target_file")"
 
     cd "$(dirname "$target_file")"
-    target_file=`basename $target_file`
+    target_file=$(basename $target_file)
 
     # Iterate down a (possible) chain of symlinks
     while [ -L "$target_file" ]
 
     # Iterate down a (possible) chain of symlinks
     while [ -L "$target_file" ]
@@ -89,7 +89,7 @@ canonicalize_filename () {
 
     # Compute the canonicalized name by finding the physical path
     # for the directory we're in and appending the target file.
 
     # Compute the canonicalized name by finding the physical path
     # for the directory we're in and appending the target file.
-    physical_directory=`pwd -P`
+    physical_directory=$(pwd -P)
     result="$physical_directory"/"$target_file"
 
     # restore the working directory after work.
     result="$physical_directory"/"$target_file"
 
     # restore the working directory after work.