How to make forward slashes be respected by java keytool in Cygwin environment?
I'm running the Java keytool program with -v $HOME/.keystore, which works fine in Unix (creates $HOME/.keystore), but in Cygin gets confused - says it is storing
/home/myaccount/.keystore
but fails with FileNotFoundException trying to write
\home\myaccount.keystore
How can I force keytool to use forward slashes? 开发者_开发问答
----> Follow up: thanks to @mikerobi below who answered my question. A little code frag for bash to use this in would be:
keystore="$HOME/.keystore"
if [ `uname -o` == 'Cygwin' ]
then
keystorefile=`cygpath -wp $keystore`
fi
Use the cygpath
utility, which can convert any cygwin path to a windows path.
keytool -v `cygpath -w "$HOME/.keystore"`
精彩评论