码迷,mamicode.com
首页 > 系统相关 > 详细

linux脚本常见问题

时间:2015-06-03 00:49:25      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

1.错误: line *: [: missing `]‘

  写脚本时,我碰到这个问题是因为if [ ]; ...else...fi语句

  解决方法: if后面的[] (test) 和条件要有空格,如:

    对于语句 if [-f "/var/www"]; then 应该写为:

    if [ -f "/var/www" ]; then

 

linux脚本常见问题

标签:

原文地址:http://www.cnblogs.com/bovenson/p/4548079.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!