我必须使用bash读出一个CSV文件。 但我的循环在1次迭代后退出。while循环在1次迭代后停止[BASH]
代码:
function readCSVFile() {
input="bitbucket-repositories.csv";
OLDIFS=$IFS
IFS=","
while read repo tool folder;
do
cd websites || exit
cloneRepo $repo
checkRepo
cd ../ || exit 0
checkTool -> calls another script (../script.bash) -> no ssh
countCSVLines
done < $input
IFS=$OLDIFS
}
尝试'回声value'更换您的退出。也许你出于某种原因退出。 – Aif
整件事情都在运行,所以这不是我想的问题。 –