Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bang as a valid char for function names #3108

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Flu
Copy link

@Flu Flu commented Dec 31, 2024

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 @koalaman

The 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function name parse failed of contain jointed pound
1 participant