适用于 Windows 7 的 Korn-Shell?
我们需要支持提供 Unix 和 Win32 端口的旧版应用程序。不幸的是,在游戏后期,很多胶水代码都是用 ksh 脚本编写的,仅适用于 unix 端口,而 Win32 端口已经失去了奇偶校验。我一直在尝试恢复它,并且一直在尝试一些 ksh-for-windows 解决方案(过去曾使用过 Zsh 的本机构建),但在 Windows 7 下似乎没有任何东西可以正常工作:Cygwin 拒绝使用Win32 和 unix 风格的路径,因此一些复杂的脚本会中断。 SUA/SFU 的情况相同。 UWin 无法在 Windows 7 上工作。我曾经使用的较旧的本机端口 (WinZsh) 也不再在 7 下工作。
因此,我需要一个类似 Korn-shell 的工作方式,可以在 Win 7(64 位)下工作会很棒,但我已经失去了希望)并且它可以与 cmd.exe 样式路径(c:/path/to/app)和标准 Unix 路径(/path/to/app)一起使用。有什么线索吗?
We need to support a legacy app that provides a Unix and a Win32 port. Unfortunately, later in the game, a lot of glue code was written in ksh scripts for the unix port only, and the Win32 port has lost parity. I've been trying to revive it, and I've been trying some ksh-for-windows solutions (a native build of Zsh used to work in the past), but nothing seems to work properly under Windows 7: Cygwin refuses to use both Win32 and unix-style paths, so some convoluted scripts break. Same situation for SUA/SFU. UWin doesn't work on Windows 7. The older native ports I used to use (WinZsh) also no longer work under 7.
So, I am in need of a Korn-shell work-alike that will work under Win 7 (64 bit would be awesome, but I've lost hope) and which can work with both cmd.exe-style paths (c:/path/to/app) and standard Unix paths (/path/to/app). Any clues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
幸运的是,Cygwin 用 mksh 取代了 pdksh(自 1999 年以来已停止使用)。然而,mksh *不*支持非 POSIX 路径,因为它主要是一个 BSD Unix shell,而且它的优势之一是在所有平台上都可以同样工作。
也就是说,Interix 中有
dos2unixpath
和unix2dospath
(IIRC)。也许你可以使用它们。像这样的东西甚至可能有效:
这会将
x:\foo\bar
转换为/dev/fs/x/foo/bar
,..\bla 到
../bla
,剩下的就不用管了。Cygwin luckily replaced pdksh (dead since 1999) with mksh. However, mksh will *not* support non-POSIX paths, as it’s primarily a BSD Unix shell, and one of its strengths is working the same across all platforms.
That being said, there’s
dos2unixpath
andunix2dospath
(IIRC) in Interix. Maybe you can use them.Something like this might even work:
This converts
x:\foo\bar
to/dev/fs/x/foo/bar
,..\bla
to../bla
, and leaves the rest alone.Cygwin 确实支持 C:/path/to/app 样式路径,尽管它喜欢抱怨它们。 (设置 CYGWIN=nodosfilewarning 将关闭它)。即使带有反斜杠的路径也受支持,但它们需要适当的引号来阻止 shell 解释它们。
Pdksh,即“公共领域 Korn Shell”,可以通过 Cygwin 的 setup.exe 安装。
Cygwin does support C:/path/to/app style paths, even though it likes to complain about them. (Setting CYGWIN=nodosfilewarning will shut it up). Even paths with backslashes are supported, but they need appropriate quoting to stop the shell from interpreting them.
Pdksh, the "Public Domain Korn Shell", can be installed through Cygwin's setup.exe.