shell coding about mac ox

1, mac path---http://blog.csdn.net/playstudy/article/details/50149021

Mac系统的环境变量,加载顺序为:
/etc/profile /etc/paths ~/.bash_profile ~/.bash_login ~/.profile ~/.bashrc

vim .bash_profile 

 

export PATH=~/mybin:$PATH

 

source .bash_profile

 

 2,cd `dirname $0`

在命令行状态下单纯执行 $ cd `dirname $0` 是毫无意义的。因为他返回当前路径的"."。
这个命令写在脚本文件里才有作用,他返回这个脚本文件放置的目录,并可以根据这个目录来定位所要运行程序的相对位置(绝对位置除外)。

 

3, 方便的安装: brew install 

 

posted @ 2017-01-10 22:23  创业-李春跃-增长黑客  阅读(217)  评论(0编辑  收藏  举报