Cygwin can't execute shell script

dmr

I am trying to execute a .sh file with Cygwin on Windows 7, and I'm getting an error cannot execute binary file.

Here is what I wrote in the Cygwin command prompt window:

$ bash cygpath --unix C:\Users\\MyName\\Documents\\MyProject\\dygraphsMaster\\generate-combined.sh

This was the result:

/usr/bin/cygpath: /usr/bin/cygpath: cannot execute binary file
admdrew

Enclose your Windows path with double quotes (") and your entire cygpath command with backticks (`).

My example:

> pwd
/cygdrive/c/TestFolder/ScriptInsideHere

> ls -al
total 1
drwx------+ 1 Administrators Domain Users  0 Aug 25 13:08 .
drwx------+ 1 Administrators Domain Users  0 Aug 25 13:13 ..
-rwx------+ 1 Administrators Domain Users 29 Aug 25 13:08 hello_world.sh

> cat hello_world.sh
#!/bin/bash
echo Hello World

Running the above:

> bash `cygpath --unix "C:\TestFolder\ScriptInsideHere\hello_world.sh"`
Hello World

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

在Cygwin中设置默认Shell

来自分类Dev

使用Cygwin的Shell脚本错误

来自分类Dev

使用Cygwin的Shell脚本错误

来自分类Dev

Cygwin无法执行Shell脚本

来自分类Dev

使用Cygwin在Windows上运行Shell脚本

来自分类Dev

Shell脚本无法在cygwin中运行

来自分类Dev

在新的Cygwin窗口中运行Shell脚本

来自分类Dev

无法使用cygwin Shell删除文件

来自分类Dev

Can't run adb commands in bash script

来自分类Dev

我应该使用Cygwin Terminal和Cygwin Bash Shell或cygwin.bat吗?

来自分类Dev

Shell Execute的安静MSI Exec

来自分类Dev

bypass Yes/No in Shell Script

来自分类Dev

untar shell script

来自分类Dev

在Linux(CygWin)Shell脚本中锁定文件(并检测该锁定)

来自分类Dev

如何在cygwin中运行bash shell脚本?

来自分类Dev

在Cygwin上使用Shell脚本时参数过多错误

来自分类Dev

在Jenkins中更改Windows Shell(从Cygwin到Git Bash / msys)

来自分类Dev

如何让Jena Fuseki在cygwin bash shell中运行?

来自分类Dev

Cygwin-Shell脚本(评估和回显)

来自分类Dev

如何在Cygwin中将fish设置为默认shell?

来自分类Dev

如何在cygwin中运行bash shell脚本?

来自分类Dev

c#(。net)在Windows上通过cygwin运行Shell脚本

来自分类Dev

等效于Unix Shell(Cygwin)中Java的String.getBytes()

来自分类Dev

Read line by line of a file in shell script where last line doesn't end with new line

来自分类Dev

can't import modules into a node script if it runs from cron

来自分类Dev

MYSQL SHELL - 来自 SHELL SCRIPT 的 SQL 模式

来自分类Dev

Execute shell command and retrieve stdout in Python

来自分类Dev

Shell script change directory with variable

来自分类Dev

Shell Script Argument without value

Related 相关文章

热门标签

归档