https://github.com/matveyt/shebang
A small helper for MSYS2/Cygwin that allows direct execution of shell scripts by Windows applications.
https://github.com/matveyt/shebang
cygwin msys2 posix shebang
Last synced: 6 months ago
JSON representation
A small helper for MSYS2/Cygwin that allows direct execution of shell scripts by Windows applications.
- Host: GitHub
- URL: https://github.com/matveyt/shebang
- Owner: matveyt
- License: bsd-2-clause
- Created: 2018-01-01T21:36:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-11-29T13:32:29.000Z (6 months ago)
- Last Synced: 2024-11-29T14:35:25.927Z (6 months ago)
- Topics: cygwin, msys2, posix, shebang
- Language: C
- Homepage:
- Size: 61.5 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
shebang
=======Summary
-------
An utility for *MSYS2/Cygwin* which allows to execute POSIX shell scripts transparently.Description
-----------
*MSYS* comes with its own port of *bash* which is able to execute shell scripts. However,
unlike ported binaries, no POSIX shell script can be executed directly from the native
Windows command-line interpretator *cmd* (or from other Windows programs, such as *FAR*,
etc.).It's quite easy to come up with the "wrapper script" solution, for example:
@rem shebang.cmd
@env MSYSTEM=MINGW64 %~n0 %*will execute any POSIX script (or native binary) called "shebang" found on PATH. However,
any (incorrectly ported) application will fail if it tries to execute such script by
spawning it directly, which is normal for the POSIX world, but not for Windows, where one
needs to provide an explicit command, such as `cmd /C shebang.cmd`. This is where
*shebang* comes to help.Building
--------
*Shebang* was successfully built and tested with *GCC/MinGW 14.1.0*.Simply invoke *make* to compile.
Using
-----
Rename or symlink *shebang*, so its name matches the script you want and put it on PATH.
Now upon execution *shebang* will find the script on PATH, parse its first (aka
"shebang") line, and execute it with own command-line arguments.