【发布时间】:2013-09-15 19:06:41
【问题描述】:
我从 Github 下载了一个 dna.sh,但我似乎无法让它在 cygwin 上运行。 当我使用命令时,
sh dna.sh
,我得到了错误,
: No such file or directory
dna.sh: line 7: $'\r': command not found
dan.sh: line 9: syntax error near unexpected token `$'do\r' '
'na.sh: line 9: `for j in f b; do
dna.sh 的内容在这里:https://github.com/jaykru/colorscripts/blob/master/dna.sh
【问题讨论】:
-
搜索with this寻找其他类似案例。
-
尝试做一个
dos2unix sna.sh或fromdos dna.sh -
你确定你复制的内容是正确的吗?因为它对我有用。
-
我想知道 Windows 行尾中额外的
\r花费了 IT 行业多少钱? -
你试过
bash dna.sh还是只是./dna.sh?也许 cygwin 中的sh没有像在 linux 系统上那样链接到bash?