utils: Add a function to check for syntactically valid shell variables
This implements the naming rules for shell variables (as documented in
SUSv4/POSIX.1-2008, dash(1) and bash(1)), but its name is more general
because it coincides with many other languages' concept of identifiers.
We'll use this when emitting environment variables in a form that can
be passed to eval(1posix), similar to `dpkg-buildflags --export=sh`,
to filter out syntactically invalid variables.
Signed-off-by:
Simon McVittie <smcv@collabora.com>
Loading
Please register or sign in to comment