Dav*_*e A 12 windows cygwin environment-variables
我正在使用Windows XP和最新版本的Cygwin.如果我在Windows系统中设置以下环境变量
JBOSS_HOME=C:/Program Files/jboss-4.2.3.GA
Run Code Online (Sandbox Code Playgroud)
然后启动Cygwin,我无法切换到继承的$ JBOSS_HOME目录.
$ cd $JBOSS_HOME
cygwin warning:
MS-DOS style path detected: C:/Program
Preferred POSIX equivalent is: /cygdrive/c/Program
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
-bash: cd: C:/Program: No such file or directory
Run Code Online (Sandbox Code Playgroud)
是否可以在Windows环境中定义我的系统变量一次,然后让Cygwin解释它,以便我不会得到这个"没有这样的文件或目录"警告?
Cos*_*sta 11
你可以做两件事之一......
export JBOSS_HOME=$( cygpath "$JBOSS_HOME" )
要么
cd "$JBOSS_HOME"
请注意,在这种情况下,您可能仍会获得相同的"cygwin警告".为了使其消失,您需要添加nodosfilewarning到CYGWIN var作为警告建议.你可以通过在.bashrc文件中添加它来做到这一点......
export CYGWIN="${CYGWIN} nodosfilewarning"