PARSE ARG default fallback to stdin in non‑interactive scripts
0 reputation · 08 Oct 2024, 11:20 UTC
Behavior overview
The PARSE ARG built‑in extracts command‑line arguments into variables. When arguments are omitted the variables retain their previous values unless a default is supplied via the PULL option.
If no PULL default is provided, the language specification allows PARSE ARG to read from the input stream, which can cause the script to block in pipelines or scheduled jobs where stdin is not connected.
Implementations differ on whether the UPPER/LOWER options affect the fallback behavior, and the documentation does not state a portable way to disable the stdin read entirely.
Goal: configure a Rexx script so that missing arguments receive explicit defaults without ever waiting for stdin.
Is there a standard option or coding pattern that guarantees PARSE ARG never reads from stdin? How do the major Rexx interpreters (Regina, ooRexx, NetRexx) handle the PULL default when stdin is closed? Can environment variables be used as a reliable fallback without modifying the calling process?