Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Robert Elz Newsgroups: gnu.bash.bug Subject: Re: Maximum length of variable name Date: Fri, 16 Nov 2018 08:49:39 +0700 Lines: 23 Approved: bug-bash@gnu.org Message-ID: References: <8491692f-8d4a-f24f-2744-2de3465a9cfd@redhat.com> <7f63f0fe-61e2-4b39-bd00-3910dba190a8@googlegroups.com> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1542333014 22236 208.118.235.17 (16 Nov 2018 01:50:14 GMT) X-Complaints-To: action@cs.stanford.edu To: RAL , bug-bash@gnu.org Envelope-to: bug-bash@gnu.org In-Reply-To: <8491692f-8d4a-f24f-2744-2de3465a9cfd@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:3c8:9009:181::2 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:14826 Date: Thu, 15 Nov 2018 12:09:46 -0600 From: Eric Blake Message-ID: <8491692f-8d4a-f24f-2744-2de3465a9cfd@redhat.com> | On 11/15/18 12:00 PM, RAL wrote: | > How is defined the maximum number of characters a variable name can have? | | Bash has no hardcoded limit, thus your maximum is dependent on how much | free memory your system has. I maintain the NetBSD sh (an ash derivative) - as part of that I have a test that (amongst other things) tests long var names - it tests up to about 1000 chars (including adding one extra char (or deleting the last) and verifying that different vars result) - I have run that test against bash with no problems at all. I can't see any reason that much longer names would not work - given that you understand that anything using them is not likely to run all that fast (and will consume more memory than you'd expect probably). kre