MSYS2 für Windows

Gast #6578962
Lesenswert?

Nutzt hier jemand MSYS2 für Windows? Im "alten" MSYS konnte man ein 
Shell Skript direkt ausführen. In MSYS2 nicht:

~/helloworld
$ helloworld.sh
sh: helloworld.sh: command not found

Es geht nur so:

~/helloworld
$ /usr/bin/sh helloworld.sh

Was muss ich da konfigurieren, damit es direkt geht?

https://www.msys2.org/
Beitrag #6578980 wurde von einem Moderator gelöscht.
Gast #6579339
Lesenswert?

Das geht. Obwohl es kein Executable ist:

~/helloworld
$ ./script.sh

Wenn man #!/bin/sh einfügt, wird es für MSYS2 zum Executable - chmod hat 
dagegen keinen Effekt:

~/helloworld
$ ls -l
-rw-r--r-- 1 xxxxxx None     23 Feb  7 19:54 helloworld.bat
-rw-r--r-- 1 xxxxxx None    117 Feb  7 19:31 helloworld.cpp
-rwxr-xr-x 1 xxxxxx None 291400 Feb  8 03:16 helloworld.exe
-rw-r--r-- 1 xxxxxx None     38 Feb  8 03:14 script.sh
-rwxr-xr-x 1 xxxxxx None     49 Feb  8 03:15 script_bash.sh

Macht aber keinen Unterschied:

~/helloworld
$ ./script_bash.sh

Da das hier auch geht, sh ist ja im $PATH, werde ich wohl das nehmen:

~/helloworld
$ sh script.sh

Aber wie gesagt, MSYS hat einfach alles versucht auszuführen. Da 
brauchte es das alles nicht.
Beitrag #6582017 wurde von einem Moderator gelöscht.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren