I recently added
alias ..=\'cd ..\'
alias ...=\'cd ../..\'
alias ....=\'cd ../../..\'
to my bash_aliases file. Playing around with this, I not
Bash aliases definitely cannot contain these characters: space , tab
\t
, newline \n
, /
, $
, `
, =
, |
, &
, ;
, (
, )
, <
, >
, '
and "
.
The GNU manual for bash https://www.gnu.org/software/bash/manual/html_node/Aliases.html says:
The characters
/
,$
,`
,=
and any of the shell metacharacters or quoting characters listed above may not appear in an alias name.
"shell metacharacters" are defined in https://www.gnu.org/software/bash/manual/html_node/Definitions.html as
A character that, when unquoted, separates words. A metacharacter is a
space
,tab
,newline
, or one of the following characters:|
,&
,;
,(
,)
,<
, or>
.
I couldn't find a list of "quoting characters" https://www.gnu.org/software/bash/manual/html_node/Quoting.html. As far as I know they are the single '
and double "
quotes.