开发者

home directory expansion (~) within an argument

When I enter the following (BASH):

rdesktop -r disk:bacon=~/bacon host

It does not expand to

rdesktop -r disk:bacon=/home/me/bacon host

It seems the "disk:" part is the problem as 开发者_运维问答can be seen in:

$ echo bacon=~/bacon disk:bacon=~/bacon

bacon=/home/me/bacon disk:bacon=~/bacon

How can I make tilde expand?


While ~ does not expand (it's used as specially routed of the path), $HOME does.

rdesktop -r disk:bacon=$HOME/bacon host

But be careful with environment-changing su!


rdesktop -r disk:bacon=$(echo ~/bacon) host

will do it. It won't please the eye, but it will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜