在 Windows 命令提示符中丢失了正斜杠的使用
我无法再在 windows xp 命令提示符处使用 / ,并且它似乎是在错误的 cygwin 安装后启动的,例如 cd /windows 不起作用,但习惯了。
谁能想到这是怎么发生的?
哎呀! 它通常不能在 XP 中运行,尽管我读到它可以在 Vista 中运行。 我简化了我的问题,但这是错误的。 真正的问题是:
我正在使用 cwrsync 二进制文件(用于 cygwin 使用),可以在命令提示符下以如下方式使用它:
ssh -i /keydir/keyfile user@server
但在做了一些事情之后(似乎是在安装 cygwin),甚至在重新安装 cwrsync 文件之后,我现在只能做:
ssh -i \keydir\keyfile user@server,即引用本地文件时必须使用 Windows 约定。
我在 cwrsync 论坛上发布了这个,但它不是很活跃,所以我希望有人能意识到这里发生了什么,我也许也应该尝试 cygwin 论坛。
I can no longer use / at the windows xp command prompt, and it seems to have started after a botched cygwin installation, e.g. cd /windows won't work, but used to.
Can anyone think of how this might have happened?
OOPS! It doesn't normally work in XP, though I had read that it does in Vista. I simplified my problem and it was wrong. The real problem is:
I was using the cwrsync binaries (meant for cygwin use) that can be used at the command prompt in a way such as:
ssh -i /keydir/keyfile user@server
but after doing something (seems like it was installing cygwin), and even after reinstalling the cwrsync files, I can now only do:
ssh -i \keydir\keyfile user@server, i.e. I have to use the windows convention when referring to local files.
I posted this on the cwrsync forum, but it's not very active, so I was hoping someone might recognize what's going on here, I should maybe try the cygwin forum too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,自 DOS 2.0 以来,内核和文件 API 一直支持正斜杠和许多命令行调用。 请参阅:http://blogs.msdn.com/larryosterman/存档/2005/06/24/432386.aspx。
当我偶然发现这一点时,我曾经煞费苦心地检测操作系统并在 PHP 中使用 PATH_SEPARATOR 类型常量(现在认为它的使用已被弃用,以代替简单的“/”)。
干杯。
Actually, since DOS 2.0, the kernel and file APIs have always supported forward slash, and many command line calls. See: http://blogs.msdn.com/larryosterman/archive/2005/06/24/432386.aspx.
I used to go to great pains to detect the OS and use a PATH_SEPARATOR type constant in PHP, when I discovered this by accident (it's use is now considered deprecated, in lieu of a simple "/").
Cheers.
你想象的——它从来没有成功过。
如果您碰巧位于
C:\
并输入它将带您到
C:\WINDOWS\
但这只是因为/windows
不是有效选项到cd
,因此它尝试忽略/
。正斜杠是 UNIX 和 cygwin 中的路径分隔符,但 Windows 将其用于命令行选项,例如。
目录/w
。You imagined it - it never worked.
If you happen to be in
C:\
and typeit will take you to
C:\WINDOWS\
but that's only because/windows
is not a valid option tocd
, so it tries ignoring the/
.Forward slash is a path separator in UNIX and cygwin, but Windows uses it for commandline options, eg.
dir /w
.