5 ms·
Awk doesn't have a way to define function-local variables. All variables are global, except for function parameters. This spacing convention is meant to clearl
by rbonvall 3y ago
Awk doesn't have a way to define function-local variables. All variables are global, except for function parameters.
This spacing convention is meant to clearly separate mandatory parameters and optional parameters that are sometimes only introduced to "declare" a local variable.
- bewuethr 3y agoHere's where the manual introduces the convention: https://www.gnu.org/software/gawk/manual/gawk.html#Variable-Scope https://www.gnu.org/software/gawk/manual/gawk.html#Variable-...
- sodapopcan 3y agoOh cool, thank you!!
- michaelcampbell 3y agoThanks; this may be one of the most weird conventions I've ever come across. Maybe that's a 'me' thing.