
看见 nodejs nvm 的安装命令: https://github.com/nvm-sh/nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash or Wget:
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash curl 的 -o 是输出到某个文件,-o- 是输出到 stdout 吗,这和不加任何参数有什么区别? wget 倒是可以理解,因为它默认是输出到文件的。
(另外,看到很多程序远程安装都提供 curl 和 wget 两个版本,是不是有些系统默认不支持 curl 或者不好用?)
1 neroxps 2019-05-17 12:05:19 +08:00 busybox 默认只有 wget |
2 trn4 2019-05-17 12:11:51 +08:00 -o-就是输出到 stdout。 有的系统既没有 wget,也没有 curl …… |
3 CSM 2019-05-17 12:14:48 +08:00 via Android 内容是二进制文件时,curl 会提示你为了不搞乱终端,截断了输出之类的,所以需要显式指定。 但是输出重定向不就不会有这个提示了,所以我猜是 -o- 看起来很萌?( ̄ ̄) |
4 ly50247 2019-05-17 12:15:32 +08:00 在这里加不加 -o- 没什么区别。 |
5 AsisA 2019-05-17 17:45:20 +08:00 应该是大写的 O 吧,大写 -O- 会输出到 stdout |
6 no1xsyzy 2019-07-09 14:08:19 +08:00 https://github.com/curl/curl/blob/92963d612b9c5ef32d63d26c72d6fff64930eba6/src/tool_operate.c#L818 config->terminal_binary_ok = (outfile && !strcmp(outfile, "-")); "-" 有区别的地方就这一个,所以应该如 #3 所说。 |