Codex use this (for update).

> sh -c 'curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh'

This is just sh, not bash, but I doubt it would be any better.