diff options
Diffstat (limited to 'guestfs-actions.pod')
-rw-r--r-- | guestfs-actions.pod | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/guestfs-actions.pod b/guestfs-actions.pod index f37ec50b..93a9fbb7 100644 --- a/guestfs-actions.pod +++ b/guestfs-actions.pod @@ -511,7 +511,9 @@ or compatible processor architecture). The single parameter is an argv-style list of arguments. The first element is the name of the program to run. Subsequent elements are parameters. The list must be -non-empty (ie. must contain a program name). +non-empty (ie. must contain a program name). Note that +the command runs directly, and is I<not> invoked via +the shell (see C<guestfs_sh>). The return value is anything printed to I<stdout> by the command. @@ -546,6 +548,8 @@ FTP. This is the same as C<guestfs_command>, but splits the result into a list of lines. +See also: C<guestfs_sh_lines> + This function returns a NULL-terminated array of strings (like L<environ(3)>), or NULL if there was an error. I<The caller must free the strings and the array after use>. @@ -1649,6 +1653,41 @@ not intended to be parsed. This function returns a string, or NULL on error. I<The caller must free the returned string after use>. +=head2 guestfs_sh + + char *guestfs_sh (guestfs_h *handle, + const char *command); + +This call runs a command from the guest filesystem via the +guest's C</bin/sh>. + +This is like C<guestfs_command>, but passes the command to: + + /bin/sh -c "command" + +Depending on the guest's shell, this usually results in +wildcards being expanded, shell expressions being interpolated +and so on. + +All the provisos about C<guestfs_command> apply to this call. + +This function returns a string, or NULL on error. +I<The caller must free the returned string after use>. + +=head2 guestfs_sh_lines + + char **guestfs_sh_lines (guestfs_h *handle, + const char *command); + +This is the same as C<guestfs_sh>, but splits the result +into a list of lines. + +See also: C<guestfs_command_lines> + +This function returns a NULL-terminated array of strings +(like L<environ(3)>), or NULL if there was an error. +I<The caller must free the strings and the array after use>. + =head2 guestfs_sleep int guestfs_sleep (guestfs_h *handle, |