I am reporting an error print I am getting when I run container-mod (including what Claude thinks is the issue). The pipeline still runs and generates intended output but (I believe) exits with non-zero exit code, which caused a pipeline I wrote which uses container-mod to fail. Mostly harmless, just thought you should know!
Description:
When running a pull with --update-repo, the following warning is printed (harmlessly, but noisily):
container-mod: line NNN: temp_file: unbound variable
Root cause:
The script sets set -uo pipefail at the top. Inside cmd_pull, a RETURN trap is registered using single quotes:
trap 'rm -f "$temp_file"' RETURN
Single quotes defer expansion — $temp_file is stored as a literal and only evaluated when the trap fires on function return. On some bash versions (common on HPC systems), the
RETURN trap executes after the function's local variable frame is torn down, so temp_file is unbound at that point. With -u active, this triggers the warning.
I am reporting an error print I am getting when I run container-mod (including what Claude thinks is the issue). The pipeline still runs and generates intended output but (I believe) exits with non-zero exit code, which caused a pipeline I wrote which uses container-mod to fail. Mostly harmless, just thought you should know!
Description:
When running a pull with --update-repo, the following warning is printed (harmlessly, but noisily):
container-mod: line NNN: temp_file: unbound variableRoot cause:
The script sets set -uo pipefail at the top. Inside cmd_pull, a RETURN trap is registered using single quotes:
trap 'rm -f "$temp_file"' RETURNSingle quotes defer expansion — $temp_file is stored as a literal and only evaluated when the trap fires on function return. On some bash versions (common on HPC systems), the
RETURN trap executes after the function's local variable frame is torn down, so temp_file is unbound at that point. With -u active, this triggers the warning.