How to set an alias so that it will change directory and run a sh file

混江龙づ霸主 提交于 2019-12-11 05:34:25

问题


I want to have an alias which will do:

>>>cd $MYUSR
>>>bin/start.sh -t

How can I set it? I use bash shell.

Best Regards


回答1:


What's wrong with the obvious?

alias example='cd $MYUSR ; ./bin/start.sh -t'

To make it permanent you can add it to ~/.bashrc



来源:https://stackoverflow.com/questions/10008648/how-to-set-an-alias-so-that-it-will-change-directory-and-run-a-sh-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!