V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
konakona
V2EX  ›  问与答

OSX 安装 Docker 后首次运行遇到一个问题: start.sh: line 61: : command not found

  •  
  •   konakona · 2016-03-03 00:40:41 +08:00 · 3586 次点击
    这是一个创建于 3188 天前的主题,其中的信息可能已经有所发展或是发生改变。

    `docker is configured to use the default machine with IP 192.168.99.100
    For help getting started, check out the docs at https://docs.docker.com

    Unknown option: n
    Usage: head [-options] <url>...
    -m <method> use method for the request (default is 'HEAD')
    -f make request even if head believes method is illegal
    -b <base> Use the specified URL as base
    -t <timeout> Set timeout value
    -i <time> Set the If-Modified-Since header on the request
    -c <conttype> use this content-type for POST, PUT, CHECKIN
    -a Use text mode for content I/O
    -p <proxyurl> use this as a proxy
    -P don't load proxy settings from environment
    -H <header> send this HTTP header (you can specify several)

    -u            Display method and URL before any response
    -U            Display request headers (implies -u)
    -s            Display response status code
    -S            Display response status chain
    -e            Display response headers
    -d            Do not display content
    -o <format>   Process HTML content in various ways
    
    -v            Show program version
    -h            Print this message
    
    -x            Extra debugging output
    

    /Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/start.sh: line 61: : command not found`

    然后打开报错的文件, 60~62 行:


    else
    "${USER_SHELL}"
    fi

    -。- 啥情况?请问有人遇到过吗?不太明白...

    knktc
        1
    knktc  
       2016-03-03 09:09:27 +08:00
    把这个 USER_SHELL 的变量打印下看看是啥咧?
    konakona
        2
    konakona  
    OP
       2016-03-03 12:23:03 +08:00
    @knktc

    bash 比较差..加入了这样的打印语句在那对 if 之前:

    echo "--start to print --"
    USER_SHELL="$(dscl /Search -read /Users/${USER} UserShell | awk '{print $2}' | head -n 1)"
    echo "${USER_SHELL}"
    echo ${USER_SHELL}

    然后我把 if else 那段先删掉了,发现问题在于`USER_SHELL=`这行上。

    打印结果为:

    --start to print --
    Unknown option: n
    Usage: head [-options] <url>...
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   957 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 20:37 · PVG 04:37 · LAX 12:37 · JFK 15:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.