我考,那得搞shell
http://wiki.ubuntu.org.cn/Shell%E7%BC%96%E7%A8%8B%E5%9F%BA%E7%A1%80
cygdrive路径转为windows路径:
#!/bin/sh
test='/cygdrive/d/windows\boot.ini'
test=${test//\\/\/}
echo ${test}
test1=${test/#\/cygdrive/}
echo $test1
test2=${test1:1:1}
echo $test1
echo $test2
test3="${test2}:${test1:2}"
echo $test3
/cygdrive/d/windows/boot.ini
/d/windows/boot.ini
/d/windows/boot.ini
d
d:/windows/boot.ini
改为函数调用
chageCygwinPathToWinPath()
{
test="$1"
test=${test//\\/\/}
test1=${test/#\/cygdrive/}
test2=${test1:1:1}
echo "${test2}:${test1:2}"
}
cygPath=`pwd`
ret=`chageCygwinPathToWinPath "$cygPath"`