-x 付けて実行してどこでエラーか見てみたら
bash -x secrets.sh