Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes misleading "No such file or directory" syntax errors from output files #2688

Merged
8 changes: 6 additions & 2 deletions scripts/exglobal_diag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,12 @@ EOFdiag
rlist="conv_gps conv_ps conv_pw conv_q conv_sst conv_t conv_uv saphir"
for rtype in $rlist; do
set +e
${CHGRP_CMD} *${rtype}*
${STRICT_ON:-set -e}
for rfile in *"${rtype}"*; do
if [[ -s "${rfile}" ]]; then
${CHGRP_CMD} "${rfile}"
${STRICT_ON:-set -e}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be out of the for loop.
If there are no files that match the *"${rtype}" or if the if condition is not satisfied, set +e will prevail at the end of the for loop. set -e should be set there based on how it is in develop.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we are checking for the file's existence, I'm not sure set +e is needed anymore at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please confirm that my update makes the correction(s) that both of you are suggesting.

fi
done
done

# If requested, create diagnostic file tarballs
Expand Down
Loading