Add bang as a valid char for function names #3108
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As described by issue #3102, the parser fails when a function name contains a pound symbol. As far as I can tell, it is a valid way of naming functions in bash, it works with the
function
keyword and without. Not sure how portable it is, but I can add a check for that as part of this PR if it's desirable by @koalamanThe only official thing I can find about function names in bash is here:
https://www.gnu.org/software/bash/manual/bash.html#Shell-Functions
It only explicitly forbids
$
in function names.This guys on SO says this:
https://stackoverflow.com/a/69292370
So it seems that every version of Bash, unless ran with --posix, supports pounds inside names.
This closes #3102