I'm playing with making a script for the first time and would like to loop through and start a few node.js apps. Every time I start the first app though the loop breaks.
I've searched for some time to get a solution and looked into the -n flag used for ssh, </dev/null and using (command) to create a new terminal for commands. Perhaps the answer is in these but I'm not seeing it.
Any help is much appreciated. Thanks!
for A in "${ARR[@]}"
do
case $A in
$APP1)
DIR=$APP1_DIR; FILE=$APP1_FILE;
;;
$APP2)
DIR=$APP2_DIR; FILE=$APP2_FILE;
;;
*)
printf "KABLAMO!"
;;
esac
if [ -d $DIR ]; then
( cd $DIR && node $FILE );
# get nothing after here on first iteration and script hangs at this point
fi
done