bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Dashes in function names: Undocumented?


From: Matthew Persico
Subject: Dashes in function names: Undocumented?
Date: Wed, 12 Aug 2020 10:51:58 -0400

I put a bug report into an emacs group because the bash syntax highlighter
failed to recognize functions whose names have dashes in them.

The maintainer came back with this:

I can reproduce this behaviour, but is it really a bug? Aren't the
names with '-' invalid?
The Bash Reference Manual says:
name
 A word consisting solely of letters, numbers, and underscores, and
 beginning with a letter or underscore. Names are used as shell
 variable and function names. Also referred to as an identifier.
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html

I looked at the manual and I didn't see positive or negative
acknowledgement that dashes can be used in function names. But it does work.

Update to manual?

name
 A word consisting solely of letters, numbers, and underscores, and
 beginning with a letter or underscore. Names are used as shell
 variables. Also referred to as an identifier.

function name
 A word consisting solely of letters, numbers, underscores, dashes, and
 beginning with a letter or underscore. Function names are used to label
shell
 functions.

-- 
Matthew O. Persico


reply via email to

[Prev in Thread] Current Thread [Next in Thread]