由文中可知,MSYS提供了一个程序cygpath用于unix path和windows path之间的转换, convert unix path to windows style 使用cygpath转将 $(pwd)) $ cygpath -u $wp /j/facelog-install/sql # 直接将字符串转为 unix路径时,'\'要转义 $ cygpath -u d:\\tmp /d/tmp 进一步研究cygpath的命令行参数发现cygpath所做的不仅是这些,还可以输出系统路径信息 比如-S显示系统文件夹(system32) $ cygpath -S /c/Windows/System32 /Desktop 下面为cygpath命令行帮助说明: Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-f FILE] [OPTION]... cygpath [-c HANDLE] cygpath [-ADHOPSW] cygpath [-F ID] Convert Unix and Windows format
--unix "${JAVA}") [ -n "${JAVA_HOME}" ] && JAVA_HOME=$(cygpath --unix "${JAVA_HOME}") fi exit 1 fi; NIFI_HOME=$(cygpath --path --windows "${NIFI_HOME}") NIFI_LOG_DIR =$(cygpath --path --windows "${NIFI_LOG_DIR}") NIFI_PID_DIR=$(cygpath --path --windows "${NIFI_PID_DIR }") BOOTSTRAP_CONF=$(cygpath --path --windows "${BOOTSTRAP_CONF}") BOOTSTRAP_CONF_DIR =$(cygpath --path --windows "${BOOTSTRAP_CONF_DIR}") BOOTSTRAP_LIBS=$(cygpath --path --windows
(Unix上名为mvn文件,Windows上为mvn.cmd),以mvn为例: if $cygwin ; then [ -n "$MAVEN_HOME" ] && MAVEN_HOME=`cygpath --unix "$MAVEN_HOME"` [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` [ -n "$ CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` fi # For MinGW, ensure paths are
cygdrive)/* ]]; then # We are in Cgywin using Windows php, so the path must be translated dir=$(cygpath cygdrive)/* ]]; then # We are in Cgywin using Windows php, so the path must be translated dir=$(cygpath
(dirname "$(echo "$0" | sed -e 's,\\,/,g')") case `uname` in *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath
-jni com.buaa.testjni.TestJNI) (这时编译成功的话在jni文件夹下就有.h文件了) 2.编译也许会遇到Unable to launch cygpath.
(dirname "$(echo "$0" | sed -e 's,\\,/,g')") case `uname` in *CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath
--unix "$JAVA_HOME"` [ -n "$CATALINA_HOME" ] && CATALINA_HOME=`cygpath --unix "$CATALINA_HOME"` [ -n "$CATALINA_BASE" ] && CATALINA_BASE=`cygpath --unix "$CATALINA_BASE"` [ -n "$CLASSPATH" ] && CLASSPATH =`cygpath --path --unix "$CLASSPATH"` [ -n "$JSSE_HOME" ] && JSSE_HOME=`cygpath --path --unix "$JSSE_HOME =`cygpath --path --windows "$CATALINA_BASE"` CATALINA_TMPDIR=`cygpath --path --windows "$CATALINA_TMPDIR "` CLASSPATH=`cygpath --path --windows "$CLASSPATH"` JSSE_HOME=`cygpath --path --windows "$JSSE_HOME"
侯注:做到这里时,控制台报出了一个错误:“Unable to launch cygpath. Is Cygwin on the path”,因为我的ndk是之前安装的,并没有专门设置环境变量。
nondestructiveif [ "${OSTYPE:-}" = "cygwin" ] || [ "${OSTYPE:-}" = "msys" ] ; then export VIRTUAL_ENV=$(cygpath
internal/core/output/lib export RPATH=$DYLD_LIBRARY_PATH;; MINGW*) extra_path=$(cygpath
findKotlinHome)" if $cygwin; then # Remove spaces from KOTLIN_HOME on windows KOTLIN_HOME=`cygpath
# If Cygwin is detected, LOG4J_DIR is converted to Windows format. (( CYGWIN )) && LOG4J_DIR=$(cygpath fi fi # If Cygwin is detected, LOG_DIR is converted to Windows format. (( CYGWIN )) && LOG_DIR=$(cygpath #:} # If Cygwin is detected, classpath is converted to Windows format. (( CYGWIN )) && CLASSPATH=$(cygpath
/usr/local/bin/greadlink checking for cygpath... [not found] checking for wslpath...
,参见StackOverflow上的解答 在Windows先开发还有一个需要注意的是,如果是使用Cygwin对native code进行编译,那么需要在使用ndk-build之前调用NDK_USE_CYGPATH
findKotlinHome)" if $cygwin; then # Remove spaces from KOTLIN_HOME on windows KOTLIN_HOME=`cygpath
& [[ -x "$JAVA_HOME/bin/java" ]]; then if [ "$windows" == "1" ]; then tmp_java_home=`cygpath -sw "$JAVA_HOME"` export JAVA_HOME=`cygpath -u "$tmp_java_home"` echo "Windows new JAVA_HOME
要转换 Cygwin 和 Windows 风格的路径可以用 cygpath。这在需要调用 Windows 程序的脚本里很有用。
要转换 Cygwin 和 Windows 风格的路径可以用 cygpath。这在需要调用 Windows 程序的脚本里很有用。
要转换 Cygwin 和 Windows 风格的路径可以用 cygpath。这在需要调用 Windows 程序的脚本里很有用。