[libvirt] [PATCH] Make virsh support '~' and '$HOME' in interactive mode

Zhang Xiaohe zhangxh at cn.fujitsu.com
Fri Mar 22 04:22:48 UTC 2013


于 2013年03月22日 11:43, Eric Blake 写道:
>
> Expanding everything means re-implementing what the shell does.
> wordexp() would be ideal for this, except that wordexp() is not portable
> enough.  By the time we end up rewriting enough code to do what
> wordexp() already could do, we are adding lots of bloat into virsh to
> make it mimic what /bin/sh can already do.
>
> Ergo, I think that this patch idea is not worth it.  If a user wants
> shell expansions, they should let the shell do it, when building up the
> virsh command line.  That is, instead of trying to do expansions in a
> virsh interactive session:
>
> $ virsh
> virsh# echo $HOME
>
> you should just let the shell do it beforehand:
>
> $ virsh "echo $HOME"
>
Thanks for explanation, I get it.





More information about the libvir-list mailing list