Hi. I wrote the following case statement to replace a series of 'ELIF' statements as it looks better and is easier to maintain. However, for some reason the commands don't fully work in this format. Take option 1. It should call a script that runs in the background but it doesn't work. Can anyone see what I'm doing wrong?
Many thanks.
case ${_OPTION} in
1) print "Running option 1: $file\n"; $(nohup ${BASE}/run_test ${file} > /dev/null 2>&1 &) ; _RC=$? ; [[ $_RC -ne 0 ]] && exit 1
;;
2) print "Running option 2: $file\n"; ${BASE}/run_test ${file}; _RC=$?; [[ $_RC -ne 0 ]] && exit 1
;;
3) print "Running option3"
;;
*)
print "[ERROR] Invalid number specified. Exiting ...\n "; exit 1
esac