mainThe GNU Bourne-Again SHell - Support: sr #109632, illegal function names allowed

 
 

sr #109632: illegal function names allowed

Submitter:  Andrey <bam80>
Submitted:  Sun 20 Jan 2019 03:35:39 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Invalid
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 01 Feb 2019 03:44:36 PM UTC, comment #2: 

Maybe we should rephrase the ticket,
it's just a placeholder for the issue being discussed:
http://lists.gnu.org/archive/html/bug-bash/2019-01/msg00203.html

Andrey <bam80>
Fri 01 Feb 2019 03:22:40 PM UTC, comment #1: 

If you want to unset a function with a name that's not a valid identifier, use `unset -f'.

Chet Ramey <chet>
Group administrator
Sun 20 Jan 2019 03:35:39 PM UTC, original submission:  

Hello,
seems like bash allows illegal function names, but refuses to unset them then:


$ function 1a () { :; }

$ declare -f 1a
1a ()
{
    :
}

$ unset 1a
bash: unset: `1a': not a valid identifier
$
GNU bash, version 4.3.48(1)-release (x86_64-slackware-linux-gnu)



The first character of a name should not be a digit: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_235

http://lists.gnu.org/archive/html/bug-bash/2019-01/msg00158.html

Andrey <bam80>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by bam80 (Submitted the item)
  • -email is unavailable- added by bam80
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-02-01 chet StatusNone Invalid
    2019-01-20 bam80 Carbon-Copy- Added bam80

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code