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

2016-03-03 00:40:41 +08:00
 konakona

`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

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

3548 次点击
所在节点    问与答
2 条回复
knktc
2016-03-03 09:09:27 +08:00
把这个 USER_SHELL 的变量打印下看看是啥咧?
konakona
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>...

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/260670

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX