bash - Are there "starts with" aliases in ZSH? -
i defined several aliases folder use; e.g.
alias x="cd /home/username/git/github/user/project"
so typing x
in terminal directly takes me project folder.
i thought nice define alias use, if string starts alias; e.g. if defined
starts-with-alias x="cd /home/username/git/github/user/project"
typing
x/abc
would take me to:
/home/username/git/github/user/project/abc
using standard shell functions, like
x() { cd /home/username/git/github/user/project/"$1"; }
x
take there, , x abc
takes /home/username/git/github/user/project/abc
.
not asked for, close.
disclaimer: tested under bash
; standard syntax may vary, zsh
one well.
Comments
Post a Comment