开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜