0 bash
我有一个写在文件中的脚本.
#!/bin/bash
if [ -f "/bin/uname" ]; then
OS=`/bin/uname`;
export OS="${OS}";
else
echo "Unable to detect OS - modify the appropriate .bashrc to support";
if
Run Code Online (Sandbox Code Playgroud)
如果我运行它,我会收到以下错误:
./temp.sh: line 9: syntax error: unexpected end of file
Run Code Online (Sandbox Code Playgroud)
但是,如果我在bash提示符下键入相同的脚本,它可以工作.
(这段代码给了我噩梦.它包含在另一个由于这6行而失败的大脚本中.我把它们放在一个单独的脚本temp.sh和temp.sh给出了同样的错误)!
问候,
J.P
| 归档时间: |
|
| 查看次数: |
1919 次 |
| 最近记录: |