Skip to content

Commit 381dc7e

Browse files
sbryngelsonclaude
andcommitted
ci: use printf over echo for sbatch script piping
More portable and defensive against script content starting with - or containing escape sequences. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ab10616 commit 381dc7e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/scripts/retry-sbatch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ retry_sbatch() {
1515

1616
while [ $attempt -le $max_attempts ]; do
1717
echo "sbatch attempt $attempt of $max_attempts..." >&2
18-
submit_output=$(echo "$script_contents" | sbatch 2>&1) || true
18+
submit_output=$(printf '%s\n' "$script_contents" | sbatch 2>&1) || true
1919
job_id=$(echo "$submit_output" | grep -oE 'Submitted batch job ([0-9]+)' | grep -oE '[0-9]+$')
2020
if [ -n "$job_id" ]; then
2121
echo "$job_id"

0 commit comments

Comments
 (0)