./vi: line 2: mkdir: command not found
当前两天博主在写脚本的时候,运行脚本时候总是出现此消息,很郁闷,
开始我以为可能是我mkdir的函数库依赖的问题,但是当我用其他的脚本创建
目录的时候,命令又可以用了,找了半天,终于找到了答案
---------------------------------------------------------------------------------------------
原来是在脚本中我定义了一个变量名称叫PATH,我们都知道,PATH是我们系统的
环境变量,当用PATH这个变量的时候,系统会自动的覆盖掉PATH环境变量,所以
我们的命令也就没有办法使用了,我们只需要把这个变量的名称改一下就可以了。hh![./vi: <wbr>line <wbr>2: <wbr>mkdir: <wbr>command <wbr>not <wbr>found ./vi: <wbr>line <wbr>2: <wbr>mkdir: <wbr>command <wbr>not <wbr>found](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)
![./vi: <wbr>line <wbr>2: <wbr>mkdir: <wbr>command <wbr>not <wbr>found ./vi: <wbr>line <wbr>2: <wbr>mkdir: <wbr>command <wbr>not <wbr>found](http://simg.sinajs.cn/blog7style/images/common/sg_trans.gif)