A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1630 ====================================================================== Reported By: mirabilos Assigned To: ====================================================================== Project: 1003.1(2016/18)/Issue7+TC2 Issue ID: 1630 Category: Base Definitions Type: Clarification Requested Severity: Objection Priority: normal Status: New Name: mirabilos Organization: mksh User Reference: Section: 3.10 Page Number: (page or range of pages) Line Number: (Line or range of lines) Interp Status: --- Final Accepted Text: ====================================================================== Date Submitted: 2023-01-20 21:39 UTC Last Modified: 2023-02-24 12:24 UTC ====================================================================== Summary: Alias names ====================================================================== Relationships ID Summary ---------------------------------------------------------------------- related to 0001050 Add support for the hyphen character in... ======================================================================
---------------------------------------------------------------------- (0006172) hvd (reporter) - 2023-02-24 12:24 https://austingroupbugs.net/view.php?id=1630#c6172 ---------------------------------------------------------------------- One problem is that implementations disagree on whether the 'alias' command takes options, and in those implementations where it does not take options, whether option processing happens. Because of this, it is not possible to define an alias with a name starting with '-' portably. In dash and osh, this works: alias -hello="echo hello" -hello In bash, bosh, gwsh, ksh, pdksh, and yash, this works: alias -- -hello="echo hello" -hello But there is not, I believe, a way to use the alias command to define an alias named '-hello' that works in all shells that allow that as an alias name unless we resort to trickery like alias dummy=dummy -hello="echo hello" unalias dummy -hello Issue History Date Modified Username Field Change ====================================================================== 2023-01-20 21:39 mirabilos New Issue 2023-01-20 21:39 mirabilos Name => mirabilos 2023-01-20 21:39 mirabilos Organization => mksh 2023-01-20 21:39 mirabilos URL => https://austingroupbugs.net/view.php?id=1050 2023-01-20 21:39 mirabilos Section => 3.10 2023-01-20 22:30 kre Note Added: 0006122 2023-01-20 22:36 kre Note Added: 0006123 2023-01-20 22:38 kre Note Edited: 0006123 2023-02-09 17:08 nick Relationship added related to 0001050 2023-02-09 17:09 geoffclare Project Online Pubs => 1003.1(2016/18)/Issue7+TC2 2023-02-13 17:19 geoffclare Note Added: 0006149 2023-02-18 20:33 mirabilos Note Added: 0006156 2023-02-24 10:03 geoffclare Note Added: 0006171 2023-02-24 12:24 hvd Note Added: 0006172 ======================================================================