0

I have installed 64-bit cygwin in the folder C:\cygwin

Running

"C:\cygwin\bin\sh.exe" /bin/ls

results in

/bin/ls: /bin/ls: cannot execute binary file

Why?

Runnin sh and ls separately works.

C:\test>"C:\cygwin\bin\sh.exe"
sh-4.4$ /bin/ls
foreign_keys  functions  procedures  props.sql  schemas.sql  tables

Using the file command, I can see that the binaries are 64-bit.

C:\test>"C:\cygwin\bin\sh.exe"
sh-4.4$ file /bin/sh
/bin/sh: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
sh-4.4$ file /bin/ls
/bin/ls: PE32+ executable (console) x86-64, for MS Windows
sh-4.4$
Anders Lindén
  • 115
  • 1
  • 8

1 Answers1

1

I have tried some variations and see that you can use:

C:\cygwin64\bin\sh.exe -c "/bin/ls"

or

C:\cygwin64\bin\bash -c "/bin/ls"

tfonias74
  • 28
  • 3