I am trying to set an alias that would allow me to quickly cd
to the following directories:
/home/user/asreera/Aravind/sample/src
/home/user/asreera/Aravind/sample2/src
First I set the variable:
set use=/home/user/asreera/Aravind/
Then I've set alias:
alias mov 'cd $use/*/src'
My intended usage is:
mov sample
It should go to directory /home/user/asreera/Aravind/sample/src
.
In case of mov sample2
it should go to directory /home/user/asreera/Aravind/sample2/src
When I use this alias I'm getting an error cd:too many arguments
Could someone please tell me what I'm doing wrong in this?
*
does not do what you think it does. You can use a shell function:$1
would then go where you put the*
.