I am trying to run bash script:
export LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH
export SUBJECTS_DIR=/output
timefmt="%C --- CPU:\t%E real,\t%U user,\t%S sys\t%P\tMem:\t%KkiBavg.,\t%MkiB max.\tExit:\t%x"
all_ids=()
for dirname in /input/*; do
id=${dirname#/input/} # remove "/input/sub-"
id=${id%/} # remove trailing "/"
printf 'Adding ID to recon-all processing list: %s\n' "${id}" >&2
if [ ! -e "/output/$id" ]; then
# no output file corresponding to this ID found,
# add it to he list
all_ids+=( "$id" )
/usr/bin/time -f "$timefmt" \
recon-all -s "${id}" -i /input/${id}/unprocessed/3T/T1w_MPR1/${id}_3T_T1w_MPR1.nii.gz -i /input/${id}/unprocessed/3T/T2w_SPC1/${id}_3T_T2w_SPC1.nii.gz
printf 'Series with t1 found, subjects matched: %s ; %s ; %s\n' "${id}"
fi
done
printf 'Found ID: %s\n' "${all_ids[@]}" >&2
printf '%s\n' "${all_ids[@]}" | parallel --jobs 6 --timeout 300% --progress recon-all -s {.} -all -qcache
I made a docker container and it executed without any result, it just goes to the place and prints printf 'Adding ID to recon-all processing list: %s\n' "${id}" >&2
, how ever if i run it with entrypoint=bash option with seperated command it executed properly.
Output of bash -x script.sh:
+ for dirname in '/input/*'
+ id=102311
+ id=102311
+ printf 'Adding ID to recon-all processing list: %s\n' 102311
Adding ID to recon-all processing list: 102311
+ '[' '!' -e /output/102311 ']'
+ all_ids+=("$id")
+ /usr/bin/time -f '%C --- CPU:\t%E real,\t%U user,\t%Ssys\t%P\tMem:\t%KkiB avg.,\t%MkiB max.\tExit:\t%x' recon-all -s 102311 -i /input/102311/unprocessed/3T/T1w_MPR1/102311_3T_T1w_MPR1.nii.gz -i /input/102311/unprocessed/3T/T2w_SPC1/102
311_3T_T2w_SPC1.nii.gz
+ printf '%s\n' 100408 100610 101006 101107 101309 101410 101915 102008 102109 102311
+ parallel --jobs 6 --timeout 300% --progress recon-all -s '{.}' -all -qcache
sh
, unless you specify otherwise. – muru Jun 24 '19 at 15:48Command terminated by signal 13
– Relyativist Jun 24 '19 at 15:59bash -x the_script.sh
. – Ole Tange Jun 24 '19 at 19:11