Mike Mestnik
2017-07-24 17:55:59 UTC
Hello,
I'm working on a parser for bash and I was unable to find an
authoritative reference on the format of variable names. One
[1]reference I found said only letters and underscore, but I'm certain
much more is allowed. Several other references I looked at were about
as much help. I'm looking for a regex, as I'm [2]writing in perl, but
any description will do.
1. https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name
2. https://github.com/cheako/MarpaX-Languages-Bash-AST/blob/ca20998abd231b60441f1decda13ee3bfcf51c64/lib/MarpaX/Languages/Bash/AST.pm#L604
I'm working on a parser for bash and I was unable to find an
authoritative reference on the format of variable names. One
[1]reference I found said only letters and underscore, but I'm certain
much more is allowed. Several other references I looked at were about
as much help. I'm looking for a regex, as I'm [2]writing in perl, but
any description will do.
1. https://bash.cyberciti.biz/guide/Rules_for_Naming_variable_name
2. https://github.com/cheako/MarpaX-Languages-Bash-AST/blob/ca20998abd231b60441f1decda13ee3bfcf51c64/lib/MarpaX/Languages/Bash/AST.pm#L604