/bin/sh
don't work.
Some POSIX applications assume that there is a /bin/sh
interpreter which takes a command via a -c
option.
In Cygnal, we can detect when an application tries to execute
/bin/sh -c command
and translate the invocation
to cmd.exe
. Doing this automatically "ports" certain programs
to Windows, such as GNU Awk. Programmers using pipes in their GNU Awk
programs just have to understand that they are are on Windows where
/bin/sh
doesn't exist, and the interpreter is
cmd.exe /c command
.
Rationale: Though this won't work satisfactorily for all programs
(in particular those which specifically require the handling of
POSIX shell syntax) it seems worth doing for those situations where it
is acceptable. Where it doesn't work, it probably doesn't make things any worse.
Programs that require a POSIX shell cannot work; they don't work whether
or not this translation hack is implemented. A possible risk is that some
valid POSIX shell command is passed to cmd.exe
such that it
has a harmful interpretation in that laguage. This seems improbable and
acceptable. In any case, programs from one environment shouldn't be deployed
blindly in another environment.
586903666abb647ad3abfc20163280ed6fdb5822