A ajuda para alias
indica que pode atribuir vários aliases de uma só vez:
alias: alias [-p] [name[=value] ... ]
Define or display aliases.
Without arguments, 'alias' prints the list of aliases in the reusable
form 'alias NAME=VALUE' on standard output.
Otherwise, an alias is defined for each NAME whose VALUE is given.
A trailing space in VALUE causes the next word to be checked for
alias substitution when the alias is expanded.
Assim, você pode usar a expansão de chaves para gerar os pares name=value
:
alias {at,cart,cst}='/bin/cat'
Então:
$ alias {at,cart,cst}='/bin/cat'
$ type at cart cst
at is aliased to '/bin/cat'
cart is aliased to '/bin/cat'
cst is aliased to '/bin/cat'
Dito isso, procure no zsh, que tem correção de erros de digitação interna (que não ajudaria para at
, mas ajudaria para os outros):
% setopt correct % sl zsh: correct 'sl' to 'ls' [nyae]? y % setopt correctall % ls x.v11r4 zsh: correct 'x.v11r4' to 'X.V11R4' [nyae]? n /usr/princton/src/x.v11r4 not found % ls /etc/paswd zsh: correct to '/etc/paswd' to '/etc/passwd' [nyae]? y /etc/passwd
If you press
y
when the shell asks you if you want to correct a word, it will be corrected. If you pressn
, it will be left alone. Pressinga
aborts the command, and pressinge
brings the line up for editing again, in case you agree the word is spelled wrong but you don't like the correction.