Reputation: 27231
The keytool does not resolve impartial directories. Ie this works:
keytool -keystore "/users/me/Desktop" ...
This doesn't:
keytool -keystore "~/Desktop" ...
Is there something that I could call like this:
keytool -keystore "$(<cmd> ~/Desktop)" ...
I guess I should actually be more specific:
This is really what I am doing:
myVar=~/Desktop
<allow user to overwrite default value of myVar>
keytool -keystore "$myVar" ...
I don't think that it is safe to have $myVar unquoted in the keytool command in case someone puts some malicious code in there.
Upvotes: 0
Views: 176
Reputation: 6735
How about
keytool -keystore "$(echo ~/Desktop)"
or
keytool -keystore "$HOME/Desktop"
But, on the other hand, ~/Desktop should work fine as well. Tried with bash only, don't have any other Bourne shells here.
Upvotes: 0
Reputation: 118671
That's because you are quoting the path. Keytool, or any other command line program in unix is agnostic of the wildrcards, because the shell is used to actually expanding the path names. If you don't quote the path, it'll work peachy.
Upvotes: 4
Reputation: 86718
I don't think this is a programming question, but did you try it without the quotes? i.e.
keytool -keystore ~/Desktop ...
Upvotes: 2