konakona
V2EX  ›  问与答

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

  •  
  •   konakona · Mar 3, 2016 · 3957 views
    This topic created in 3735 days ago, the information mentioned may be changed or developed.

    `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  
       Mar 3, 2016
    把这个 USER_SHELL 的变量打印下看看是啥咧?
    konakona
        2
    konakona  
    OP
       Mar 3, 2016
    @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>...
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3515 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 11:15 · PVG 19:15 · LAX 04:15 · JFK 07:15
    ♥ Do have faith in what you're doing.