1- # /usr/bin/env bash
1+ #! /usr/bin/env bash
22#
33# windows-install.sh
44#
@@ -121,6 +121,7 @@ if [[ "${arg_d}" == "${__flag_present}" ]]; then
121121fi
122122
123123# Get linux_distribution name
124+ # shellcheck disable=SC2154
124125{
125126info " __file: ${__file} "
126127info " __dir: ${__dir} "
@@ -144,7 +145,8 @@ info "-V (--version-number): ${arg_V}"
144145
145146# __________ Process command-line arguments and environment variables _____________
146147
147- export this_script=" $( basename " $0 " ) "
148+ this_script=" $( basename " $0 " ) "
149+ export this_script
148150debug " this_script=\" ${this_script} \" "
149151
150152export install_prefix=" ${arg_i%/:- ${PWD} / prerequisites/ installations} "
@@ -165,7 +167,7 @@ verify_this_is_ubuntu()
165167 if [[ ${__os} != " Linux" ]]; then
166168 emergency " ${__os} not supported: this script is intended for use in Windows Subsystem for Linux "
167169 fi
168- linux_standard_base_i=` lsb_release -i`
170+ linux_standard_base_i=$( lsb_release -i)
169171 untrimmed_name=${linux_standard_base_i##* Distributor ID: }
170172 linux_distribution=" ${untrimmed_name// [[:space:]]/ } "
171173 info " Linux distribution: ${linux_distribution} "
@@ -180,7 +182,7 @@ verify_this_is_ubuntu
180182# Ubuntu 16.04 apt-get installs gfortran 5.4.0 or later, which is acceptable for many uses of OpenCoarrays
181183verify_acceptable_release_number ()
182184{
183- linux_standard_base_r=` lsb_release -r`
185+ linux_standard_base_r=$( lsb_release -r)
184186 untrimmed_name=${linux_standard_base_r##* Release: }
185187 release_number=" ${untrimmed_name// [[:space:]]/ } "
186188 major_release=" ${release_number%% .* } "
@@ -260,20 +262,20 @@ else
260262 fi
261263 }
262264 set_SUDO_if_needed_to_write_to_install_dir
263-
265+
264266 # Install OpenCoarrays
265267
266268 if [[ -d " $build_path " ]]; then
267269 rm -rf " $build_path "
268270 fi
269271 mkdir -p " $build_path "
270- cd " $build_path "
272+ cd " $build_path " || exit 25
271273 info " Configuring OpenCoarrays with the following command:"
272274 info " FC=\" $FC \" CC=\" $CC \" \" $CMAKE \" \" $OPENCOARRAYS_SRC_DIR \" -DCMAKE_INSTALL_PREFIX=\" $install_prefix \" "
273275 FC=" $FC " CC=" $CC " " $CMAKE " " $OPENCOARRAYS_SRC_DIR " -DCMAKE_INSTALL_PREFIX=" $install_prefix "
274276 info " Building OpenCoarrays with the following command:"
275277 info " make -j $arg_j "
276- make -j $ arg_j
278+ make -j " ${ arg_j} "
277279 info " Installing OpenCoarrays with the following command:"
278280 info " ${SUDO:- } make install"
279281 ${SUDO:- } make install
285287 emergency " $install_prefix "
286288 fi
287289 # See http://stackoverflow.com/questions/31057694/gethostbyname-fail-after-switching-internet-connections/31222970
288- loopback_line=` grep $ NAME /etc/hosts`
290+ loopback_line=$( grep " ${ NAME} " /etc/hosts)
289291 if [[ -z " ${loopback_line:- } " ]]; then
290292 info " To ensure the correct functioning of MPI, please add the following line to your /etc/hosts file:"
291293 info " 127.0.0.1 $NAME "
0 commit comments