[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

于 2013年03月21日 21:08, Eric Blake 写道:
On 03/21/2013 04:20 AM, Daniel P. Berrange wrote:

In other words, if we're going to do this, go all the way and use
wordexp() to get shell-like expansion, instead of reinventing it
ourselves.  Except that wordexp() is not portable to mingw, and not
provided in gnulib.

Also, we'll need a way to escape the special meaning of '~'
and '$' to get them treated as literal characters instead of
special characters.

We already have the ability to quote characters, so that we can embed
spaces; our quoting rules are (intentionally) copied on shell rules, so
they would still work with a wordexp() approach.

This seems better than just expanding $HOME, i will try this wordexp().
One question, is variable can be accepted in the position of command
and option? That is, is this form
virsh # $VAR --$OPT=~/rpmbuild
could be valid?

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]