I am trying to use fish as my default interactive shell. I was previously using bash and there was support for alias named -
(ASCII hyphen, 0x2d). Why does not fish allow creation of alias or function with such name? As far as I know, it has no special meaning in fish.
Bash-like invocation of alias
is not possible:
fish-3.1.2$ alias -- -='aliased command'
- (line 1): function: Illegal function name '-'
function - --wraps 'aliased command' --description 'alias -=aliased command'; aliased command $argv; end
^
from sourcing file -
called on line 61 of file /usr/share/fish/functions/alias.fish
in function 'alias' with arguments '-- -=aliased\ command'
alias -- -='some command'
? Note not all shells support hyphens. See bash - Are there problems with hyphens in functions, aliases, and executables? - Unix & Linux Stack Exchange `