Fix worker count awk portability

This commit is contained in:
juvdiaz 2026-06-29 23:43:23 -06:00
parent cc7811b152
commit fa54989dee
1 changed files with 4 additions and 4 deletions

View File

@ -4444,12 +4444,12 @@ pimox_worker_count_default() {
if [[ -s "${spec_file}" ]]; then if [[ -s "${spec_file}" ]]; then
count="$(awk -F'\t' -v key_prefix="${worker_key_prefix}" -v node_prefix="${worker_node_prefix}-" ' count="$(awk -F'\t' -v key_prefix="${worker_key_prefix}" -v node_prefix="${worker_node_prefix}-" '
$1 ~ "^" key_prefix "[0-9]+$" { $1 ~ "^" key_prefix "[0-9]+$" {
index = substr($1, length(key_prefix) + 1) + 0 worker_index = substr($1, length(key_prefix) + 1) + 0
if (index > max) max = index if (worker_index > max) max = worker_index
} }
$4 ~ "^" node_prefix "[0-9]+$" { $4 ~ "^" node_prefix "[0-9]+$" {
index = substr($4, length(node_prefix) + 1) + 0 worker_index = substr($4, length(node_prefix) + 1) + 0
if (index > max) max = index if (worker_index > max) max = worker_index
} }
END { print max + 0 } END { print max + 0 }
' "${spec_file}")" ' "${spec_file}")"