Skip to content

bug or don't support: strange function names compatibility #1220

Description

@Kamilcuk

brush version

brush 0.4.0 (git:85f6283)

bash version (for comparison)

3.2+

Platform / OS

Linux

Steps to reproduce

Bash is quite frivolous when it comes to function names in non-interactive shell. I wonder if such function names should be supported at all. I would even vote that these characters *? just should not be supported at all. But fyi they are supported by Bash. Related: https://stackoverflow.com/questions/28114999/what-are-the-rules-for-valid-identifiers-e-g-functions-vars-etc-in-bash .

The following code defines a function named "a.*".

Actual behavior (brush)

$ brush -c 'a.*() { echo 123; }; "a.*"'
error: -c: syntax error at line 1 col 20

Expected behavior

$ bash -c 'a.*() { echo 123; }; "a.*"'
123

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compatRelated to compatibility with standard shellsbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions