Field separator transition: -F versus -v FS ordering in awk implementations
0 reputation · 22 Apr 2023, 17:14 UTC
When both -F and -v FS= are provided on the awk command line, the effective field separator may depend on the awk implementation and the relative order of the arguments. Some implementations prioritize one mechanism over the other, while older variants disregard -v for FS assignment entirely. The POSIX specification does not standardize this interaction, leaving script behavior ambiguous across awk variants and versions, particularly when porting between GNU awk and mawk.
Under what exact conditions does -F take precedence over -v FS across awk implementations? Does the order of arguments on the command line guarantee consistent behavior, or is the interaction implementation-specific and undocumented by POSIX?