加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

mkdir: missing operand in ubuntu

(2016-07-12 16:48:06)
标签:

it

分类: VM_setting

在两台ubuntu跑同样的脚本,然后其中一台报错如下:

mkdir: missing operand
Try `mkdir --help' for more information.
mkdir: missing operand
Try `mkdir --help' for more information.

一开始查了网站http://stackoverflow.com/questions/2743673/mkdir-error-in-bash-script 里面讲到的

修改mkdir -p $deploydir 成 mkdir -p "$deployDir" 就可以,但实际上还是不行。

 

查了一下,感觉是编译脚本有问题。最后发现当前ubuntu的版本4.2用的是dash,而另一台的版本是3.19用的是bash


查看与使用
先用命令ls -l /bin/sh 看看
结果是: /bin/sh -> dash

要修改默认的sh,可以采用命令
sudo dpkg-reconfigure dash
然后选择【否】
成功后再执行ls -l /bin/sh 看看
结果是: /bin/sh -> bash
修改成功!
然后脚本可以跑通了!


注:
什么是bash
Bash(GNU Bourne-Again Shell)是许多Linux平台的内定Shell,事实上,还有许多传统UNIX上用的Shell,像tcsh、csh、ash、bsh、ksh等等,Shell Script大致都类同,当您学会一种Shell以后,其它的Shell会很快就上手,大多数的时候,一个Shell Script通常可以在很多种Shell上使用
什么是dash
dash is the standard command interpreter for the system.  The current
version of dash is in the process of being changed to conform with the
POSIX 1003.2 and 1003.2a specifications for the shell.

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有