Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Eli Schwartz Newsgroups: gnu.bash.bug Subject: Re: Dashes in function names: Undocumented? Date: Wed, 12 Aug 2020 11:05:40 -0400 Lines: 110 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NgA9oXRF0usctKK0zI3gjmEQNcEGGqLmX" X-Trace: usenet.stanford.edu 1597244760 5311 209.51.188.17 (12 Aug 2020 15:06:00 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org X-Spam-BL-Results: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1597244744; bh=oV6tQKdz5aMBbE7+2Va5PLQ2a5sMaqEpd5DOLhmOhgw=; h=Subject:To:References:From:Date:In-Reply-To; b=SeOOokn66Gornk+uMHuX61JjW9Z8g1gpRYJ8VBBVzA6ZZ9EQ8I6bdOOPF8b/88kMO Rn4CfoiB9vyIBPfV/c4yeZmuNl+kAWIuJCyY0gDz+OW8lJ14apwqwOy+TkyEkQxBvD gYq9mFglAHgKy7VyBpy37402VCtnD6VF4cL6QUcjhcgbolRXLYvB3vEH5aI2RYYw1i X/4LZRU0V9Qx/xwWJnK95T0uWj94C3KwdKdrBTwqz44IHtdSeewpHKILa6TwAXO+/3 7yYzxu0eGT3/OEkzMn38tFjnkVYqgShNOPHQAoz8NwdIdqTOpY6KSci4rCoP/jNcF1 SuuH+4fEvevnBIBXFHofXA1ap43tohtl0DolRIt20z6qxxth6XO+CsY77Noa+zGGaI kZEF4vWPhwVBzuBfvgC3iIWUYL6RpE0M3WrqeXC8+jEUaFIGKYyJtRfcDIZLYUVLcN sY/7MJNztRmJT+x3y9/Bgmp9QcHBsP69NxEYb4HiQWm4LV12tMQ9dGozIHieXJ3+8c qXOAaUHNyT/EK7w+UunJhWzcC1CI4lrgLPJYat7pdZOPGnz2syEEzdYrnuCowzQNDh XoR9DnXpC9Q6y2FqHVrk4n64stzIcUDQVRIMo8rMYwbgeqHPt5L9UXgN9lKrDLaz0F /e1KUmfeKoQG1QUD1lzCkZ7Q= X-Clacks-Overhead: GNU Terry Pratchett In-Reply-To: Received-SPF: pass client-ip=2a01:4f8:160:6087::1; envelope-from=eschwartz@archlinux.org; helo=orion.archlinux.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -53 X-Spam_score: -5.4 X-Spam_bar: ----- X-Spam_report: (-5.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com gnu.bash.bug:16745 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --NgA9oXRF0usctKK0zI3gjmEQNcEGGqLmX Content-Type: multipart/mixed; boundary="ZBB89s0uFl0Dbgl4j9ikxUTN74ZLBwcR1" --ZBB89s0uFl0Dbgl4j9ikxUTN74ZLBwcR1 Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: quoted-printable On 8/12/20 10:51 AM, Matthew Persico wrote: > I put a bug report into an emacs group because the bash syntax highligh= ter > failed to recognize functions whose names have dashes in them. >=20 > The maintainer came back with this: >=20 > 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 >=20 > 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. >=20 > Update to manual? The bash-20191127 snapshot updated the manpage documentation for a function definition (to align with reality). It is now defined as: function fname [()] compound-command [redirection] and includes the description: When in posix mode, fname must be a valid shell name and may not be the name of one of the POSIX special builtins. In default mode, a function name can be any unquoted shell word that does not contain $. For context: word - A sequence of characters considered as a single unit by the shell. Also known as a token. name - A word consisting only of alphanumeric characters and underscores, and beginning with an alphabetic character or an underscore. Also referred to as an identifier. > 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. >=20 > function name > A word consisting solely of letters, numbers, underscores, dashes, and= > beginning with a letter or underscore. Function names are used to labe= l > shell > functions. >=20 --=20 Eli Schwartz Bug Wrangler and Trusted User --ZBB89s0uFl0Dbgl4j9ikxUTN74ZLBwcR1-- --NgA9oXRF0usctKK0zI3gjmEQNcEGGqLmX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEvSewel70XCra9w4EhIGKaBmvSpsFAl80BUQACgkQhIGKaBmv Spug/A//ST1s8eBJIHcnjlL7FKcYLRY3Igqh+LMJZQ3U785rWQR312rYAuQ6c4+Z EFsL/kaf6tbeVvvCBu18dmDCjUuUFNVwkFj1NzCVlZMW3d9C/T/XvvbLXKRmzuuO 8SJvt2WBN1ZEMGnOaMog52bAgi1ZlaNXvW/1m/Ia1Woo0PJkWX3mz7+CXOOkQNNq Ce5e89ZbIHiXRcMe5GFaZ0b2OBsUnkAk4akICl1p2YYOiheVKMBHZodrV2dqR7b3 Xxd0IZ62ylg5Dbsv1qlPE5LlSBl39fI93JxEOSROewHEl2wxIgM1nEq1ejStVxHu pgYrs0MBmFfn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