Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.bash.bug > #16744

Dashes in function names: Undocumented?

From Matthew Persico <matthew.persico@gmail.com>
Newsgroups gnu.bash.bug
Subject Dashes in function names: Undocumented?
Date 2020-08-12 10:51 -0400
Message-ID <mailman.1734.1597243937.2739.bug-bash@gnu.org> (permalink)
References <CAL20dLDNniiOycTe-j6t0ynS+9FG32UgDGJbn+iDEMG7Ls_==Q@mail.gmail.com>

Show all headers | View raw


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

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Dashes in function names: Undocumented? Matthew Persico <matthew.persico@gmail.com> - 2020-08-12 10:51 -0400

csiph-web