i have bash script(1.sh) which calls (2.sh) within a while loop. Execution stops after just one iteration. if i remove call to 2.sh it executes perfectly
my code 1.sh
while read -a A ; do
echo "${GREEN} Making production build for ${A[0]} ${NC}"
# run build for each component
./2.sh ${A[0]} ${A[1]}
if [[ $? -eq 1 ]]; then
# create logs of error builds
ERRORBUILDS+=${A[0]}" ,"
fi
done < $1
$1on a different file descriptor and close it within the loop. See examples at Why is using a shell loop to process text considered bad practice?2.sh's stdin from /dev/null (add< /dev/null). The question would we why it reads from its stdin and what it expects to find there.