【发布时间】:2013-12-10 16:13:27
【问题描述】:
这个想法是消除当一个人连接到在 windows 框 (sshd) 中作为服务运行的 cygwin 守护程序时发出的 CYGWIN 警告:
问题案例:
> ssh -i <my private key> me@server "ls d://path//to//folder//"
cygwin warning:
MS-DOS style path detected: d://path//to//folder//
Preferred POSIX equivalent is: /cygdrive/d/path/to/folder/
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
[...]
此警告可能导致执行的远程命令返回警告而不是“0”状态代码。
警告告诉我们在 CYGWIN 环境变量中设置以下值:"nodosfilewarning"
问题是,无论在以下任何地方设置它,它都不会进入远程环境:
- Windows 用户环境变量
- Windows 系统环境变量
- ~/.bashrc
- ~/.profile
- /etc/bashrc
- /etc/profile 等
测试用例:
> ssh -i <my private key> me@server "env | grep CYGWIN"
CYGWIN=CYGWIN sshd
CYGWIN 环境变量永远不会包含正确的值,无论您在哪里设置它...
【问题讨论】:
标签: windows cygwin warnings dos sshd