[libvirt] [PATCH 2/1] virsh: Elide backslash-newline in batch mode

John Ferlan jferlan at redhat.com
Mon Feb 25 16:51:05 UTC 2019



On 2/21/19 3:20 PM, Eric Blake wrote:
> The previous patch made it possible to split multiple commands by
> adding newline, but not to split a long single command. The sequence
> backslash-newline was being used as if it were a quoted newline
> character, rather than completely elided the way the shell does.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  tools/virsh.pod      | 4 +++-
>  tools/virt-admin.pod | 3 ++-
>  tools/vsh.c          | 8 ++++++--
>  3 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/virsh.pod b/tools/virsh.pod
> index 2bf1ee77bb..4057edf3a7 100644
> --- a/tools/virsh.pod
> +++ b/tools/virsh.pod
> @@ -41,7 +41,9 @@ The B<virsh> program can be used either to run one I<COMMAND> by giving the
>  command and its arguments on the shell command line, or a I<COMMAND_STRING>
>  which is a single shell argument consisting of multiple I<COMMAND> actions
>  and their arguments joined with whitespace, and separated by semicolons or

I think you meant to chop the above line too...

> -newlines between commands.  Within I<COMMAND_STRING>, virsh understands the
> +and their arguments joined with whitespace, and separated by semicolons or
> +newlines between commands, and where unquoted backslash-newline pairs are

s/, and where/, where/

> +elided.  Within I<COMMAND_STRING>, virsh understands the
>  same single, double, and backslash escapes as the shell, although you must
>  add another layer of shell escaping in creating the single shell argument.
>  If no command is given in the command line, B<virsh> will then start a minimal
> diff --git a/tools/virt-admin.pod b/tools/virt-admin.pod
> index b2c9a1db6d..e1513e27e5 100644
> --- a/tools/virt-admin.pod
> +++ b/tools/virt-admin.pod
> @@ -24,7 +24,8 @@ The B<virt-admin> program can be used either to run one I<COMMAND> by giving the
>  command and its arguments on the shell command line, or a I<COMMAND_STRING>
>  which is a single shell argument consisting of multiple I<COMMAND> actions
>  and their arguments joined with whitespace, and separated by semicolons or

Same here.

> -newlines between commands.  Within I<COMMAND_STRING>, virt-admin understands the
> +newlines between commands, and where unquoted backslash-newline pairs are

s/, and where/, where/

Reviewed-by: John Ferlan <jferlan at redhat.com>

John

> +elided.  Within I<COMMAND_STRING>, virt-admin understands the
>  same single, double, and backslash escapes as the shell, although you must
>  add another layer of shell escaping in creating the single shell argument.
>  If no command is given in the command line, B<virt-admin> will then start a minimal

[...]




More information about the libvir-list mailing list