参数内的主目录扩展 (~)
当我输入以下内容(BASH)时:
rdesktop -r disk:bacon=~/bacon host
它不会扩展为
rdesktop -r disk:bacon=/home/me/bacon host
似乎“磁盘:”部分是问题所在,如:
$ echo bacon=~/bacon disk:bacon=~/bacon
bacon=/home/me/bacon disk:bacon=~/bacon
How can I make tilde Expand?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然 ~ 不会扩展(它用作路径的特殊路由),但
$HOME
会扩展。但要小心改变环境的
su
!While ~ does not expand (it's used as specially routed of the path),
$HOME
does.But be careful with environment-changing
su
!rdesktop -r disk:bacon=$(echo ~/bacon) host
就可以了。它不会让人赏心悦目,但它会起作用。
rdesktop -r disk:bacon=$(echo ~/bacon) host
will do it. It won't please the eye, but it will work.