bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a Windows native port of Bash or Bourne Shell(no cygwin)?


From: Chen(陈) Jun(军)
Subject: Re: Is there a Windows native port of Bash or Bourne Shell(no cygwin)?
Date: Tue, 29 Jan 2008 11:10:07 +0800

On 1/28/08, Eric Blake <address@hidden> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Chen (陈) Jun (军) on 1/27/2008 11:01 PM:
> | Hi, everyone,
> |
> | I'm new to this list. I'd like to ask is there a Windows native port of
> | Bash or Bourne Shell?
>
> Yes.  Search for the MSYS project (layered on top of mingw).  If it
> doesn't work on vista yet, then they would probably welcome your help.


 Thank you Eric, but MSYS is not what I've expected. I've know MSYS since
year 2004, and I've found it totally a weirdo. If I would want to build
something from Unix world that needs a bash environment, I would turn to
Linux or cygwin instead of MSYS.

Let's check what sh.exe from MSYS(1.0.10) do. I install MSYS so that there
is E:/msys/1.0/bin/sh.exe ; I change my working directory to E:\msys\1.0\bin
.

Now, lets issue command

sh -c "pwd"

It outputs:

/bin

Oouups, what I expect was E:/msys/1.0/bin .

Now, I've prepared a program called showargs, who shows argv[0], argv[1] etc
passed to it. Let's try it with MSYS's sh.exe.

>>>>>>>>>>>>>>>>>
E:\msys\1.0\bin>sh -c "./showargs -opt /c /es"
argc=4.
(28)argv[0]: E:\msys\1.0\bin\showargs.exe
(4)argv[1]: -opt
(3)argv[2]: c:/
(14)argv[3]: E:/msys/1.0/es
<<<<<<<<<<<<<<<<<

Suprised? You now know what the weird sh.exe does. It checks whether some
token starts with / , if so, it considers that toke a path and applies
trasformation. This is utterly rude. So this sh.exe cannot cooperate with
many existing Windows programs.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]