Bash - cd your instance rather than sub process
So I've crea开发者_JAVA技巧ted a bash script that takes argument and then (I want it to) cd me into a directory.
It's not quite a case of cd /home/$1 for example, it's a bit more complex.
The problem is (as I knew it would be) it's cding the sub process rather than my instance of bash.
Is there any way to apply it to my open bash?
Echo the desired directory, then create a bash alias as follows:
alias jump="cd $(myscript.sh)"
It's the approach I use for autojump, and it works very well.
I guess this is another option for you
favorite directory
精彩评论