stnava/ANTs — pull request #59 by yarikoptic (2013-12-11 18:16:32+00:00)
Title: BF: explicitly specify to use bash instead of generic POSIX compliant sh

As reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690622 some scripts have "bashisms" -- features which are present only in bash but not in a limited, but still POSIX compliant shells such as dash (default on many systems nowadays to speed up boot etc).

Here is a current list from running bashishsms tool

```
possible bashism in Scripts/ANTSAverage2DAffine.sh line 22 (let ...):
for x in $LL ; do PARAM1=` awk -v a=$PARAM1 -v b=$x 'BEGIN{print (a + b)}' ` ; let NFILES=$NFILES+1 ; done
possible bashism in Scripts/ANTSAverage3DAffine.sh line 29 (let ...):
for x in $LL ; do PARAM1=` awk -v a=$PARAM1 -v b=$x 'BEGIN{print (a + b)}' ` ; let NFILES=$NFILES+1 ; done
possible bashism in Scripts/guidedregistration.sh line 4 (unsafe echo with backslash):
echo " USAGE \n sh command.sh fixed.nii fixedhipp.nii moving.nii movinghipp.nii outputname iterations DIM "
possible bashism in Scripts/landmarkmatch.sh line 4 (unsafe echo with backslash):
echo " USAGE \n sh $0 fixed.nii fixedhipp.nii moving.nii movinghipp.nii ITERATIONS LandmarkWeight "
possible bashism in Scripts/landmarkmatch.sh line 28 (let ...):
let DD=MM-NN
possible bashism in Scripts/landmarkmatch.sh line 37 (let ...):
let DD=MM-NN
possible bashism in Scripts/lohmann.sh line 45 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ ! -s ${OUTPUTNAME}repaired.nii.gz ]] ; then
possible bashism in Scripts/lohmann.sh line 51 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ ! -s $WM ]] ; then
possible bashism in Scripts/lohmann.sh line 57 (alternative test command ([[ foo ]] should be [ foo ])):
if [[ ! -s ${OUT}max.nii.gz ]] ; then
possible bashism in Scripts/weightedaverage.sh line 3 (unsafe echo with backslash):
echo "Usage: \n sh weightedaverage.sh \"Faces*tiff\" \n "
```

although alternative is to fix the scripts, but IMHO it would be better just to
switch to use bash (present everywhere anyways) for the shell interpreter for those scripts.