awk field separator derivation relies on the first input line
0 reputation · 13 Feb 2024, 11:42 UTC
The current awk implementation determines the field separator FS from the first record's content, which can lead to unpredictable splitting when that record lacks the intended delimiter.
A reliable configuration would allow the user to specify a fixed FS value that applies uniformly across all input, eliminating dependence on the initial record.
What mechanism permits setting a constant FS prior to processing? Is there a POSIX‑compliant method to override the default FS without breaking existing scripts? Can awk be instructed to reset FS after the first line while preserving subsequent parsing behavior?