ufs-community / regional_workflow

THIS REPOSITORY IS NOW DEPRECATED; SEE UFS SRW APP FOR CURRENT CODE
https://github.com/ufs-community/ufs-srweather-app
Other
10 stars 86 forks source link

bash echo/printf with single and double quotes bug #815

Closed danielabdi-noaa closed 2 years ago

danielabdi-noaa commented 2 years ago

Description

Adding a CRONTAB_LINE with bash printf/echo have used both single and double quotes in the past to surround the crontab contents. SRW app adds crontab lines of the following form which has double quotes inside for "TRUE". So it makes sense to surround it with single quotes. If double quotes are used, the quotes for "TRUE" will be lost and there will not be a match with CRONTAB_LINE later when looking for a match for deletion purposes

'*/2 * * * * cd /scratch1/BMC/zrtrr/Daniel.Abdi/rrfs/benchmark-test/deactivate_tasks && ./launch_FV3LAM_wflow.sh called_from_cron="TRUE" >> ./log.launch_FV3LAM_wflow 2>&1'

On the other hand, using single quotes to surround the content, we encountered a problem with ci-hera-intel-WE label because you don't get a clean cron table, and there are comments and other crontab lines from other users that have single quotes. The "printf/echo" fail to run properly, as a result the automated test does not run properly.

Whether one uses single or double quotes to surround the crontab contents, you will encounter one of the problems above.

Steps to Reproduce

Test a PR with ci-hera-intel-WE label

Additional Context

Not needed

Output

Machine: hera
Compiler: intel
Job: WE
Repo location: /scratch1/BMC/zrtrr/rrfs_ci/autoci/pr/944706962/20220722215010/ufs-srweather-app
Build was Successful
Rocoto jobs started
Long term tracking will be done on 9 experiments
If test failed, please make changes and add the following label back:
ci-hera-intel-WE