我跑了这个:
wget -o ready-for.sh "https://training.linuxfoundation.org/cm/prep/ready-for.sh"
chmod a+x ./ready-for.sh
./ready-for.sh LFS265
Run Code Online (Sandbox Code Playgroud)
并得到错误:
ready-for.sh line-1 command not found
Run Code Online (Sandbox Code Playgroud)
hee*_*ayl 14
您使用了错误的 选项wget
。
要保存文档/文件,您需要-O
(大写 o)。要保存日志,即 STDERR 上显示的任何内容,您需要-o
.
当您使用 时-o
,您已将日志另存为,ready-for.sh
并且大概该文件不包含 可理解的任何内容bash
,因此出现错误。
简而言之,请执行以下操作:
wget -O ready-for.sh "https://training.linuxfoundation.org/cm/prep/ready-for.sh"
Run Code Online (Sandbox Code Playgroud)
然后您应该能够以ready-for.sh
通常的方式执行脚本。
也不要忘记检查man wget
.