X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=fish%2Fguestfish.pod;h=836c4f7f9ca63397ca209e3b5c9ade5f58500cae;hp=13a9fa7dd2d917233c4a37c0f0612e5e6e39bc7f;hb=3119aa687d4d594b50ee9df5ff6e8d709eb7ca85;hpb=8980c01b46eafcf4b5dc127e4696c2cbe1bff09f diff --git a/fish/guestfish.pod b/fish/guestfish.pod index 13a9fa7..836c4f7 100644 --- a/fish/guestfish.pod +++ b/fish/guestfish.pod @@ -98,7 +98,7 @@ the functionality of the guestfs API, see L. Guestfish gives you structured access to the libguestfs API, from shell scripts or the command line or interactively. If you want to -rescue a broken virtual machine image, you might want to look at the +rescue a broken virtual machine image, you should look at the L command. Using guestfish in read/write mode on live virtual machines can be @@ -296,6 +296,27 @@ must be escaped with a backslash. command "/bin/echo 'foo bar'" command "/bin/echo \'foo\'" +=head1 NUMBERS + +Commands which take integers as parameters use the C convention which +is to use C<0> to prefix an octal number or C<0x> to prefix a +hexadecimal number. For example: + + 1234 decimal number 1234 + 02322 octal number, equivalent to decimal 1234 + 0x4d2 hexadecimal number, equivalent to decimal 1234 + +When using the C command, you almost always want to specify an +octal number for the mode, and you must prefix it with C<0> (unlike +the Unix L program): + + chmod 0777 /public # OK + chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal. + +Commands that return numbers usually print them in decimal, but +some commands print numbers in other radices (eg. C prints +the mode in octal, preceeded by C<0>). + =head1 WILDCARDS AND GLOBBING Neither guestfish nor the underlying guestfs API performs @@ -348,6 +369,9 @@ will create a directory C on the host, and then export the contents of C on the mounted filesystem to C. (See C). +To change the local directory, use the C command. C will +have no effect, due to the way that subprocesses work in Unix. + =head1 PIPES Use CspaceE | command> to pipe the output of the @@ -363,6 +387,7 @@ Other examples: hexdump /bin/ls | head list-devices | tail -1 + tgz-out / - | tar ztf - The space before the pipe symbol is required, any space after the pipe symbol is optional. Everything after the pipe symbol is just passed @@ -461,6 +486,39 @@ user ID of the process, and C<$PID> is the process ID of the server. Guestfish client and server versions must match exactly. +=head1 UPLOADING AND DOWNLOADING FILES + +For commands such as C, C, C, C and +others which upload from or download to a local file, you can use the +special filename C<-> to mean "from stdin" or "to stdout". For example: + + upload - /foo + +reads stdin and creates from that a file C in the disk image, +and: + + tar-out /etc - | tar tf - + +writes the tarball to stdout and then pipes that into the external +"tar" command (see L). + +When using C<-> to read from stdin, the input is read up to the end of +stdin. You can also use a special "heredoc"-like syntax to read up to +some arbitrary end marker: + + upload -<. The end +marker must appear on a line of its own, without any preceeding or +following characters (not even spaces). + +Note that the C<-EE> syntax only applies to parameters used to +upload local files (so-called "FileIn" parameters in the generator). + =head1 GUESTFISH COMMANDS The commands in this section are guestfish convenience commands, in @@ -719,11 +777,16 @@ I<1> if there was an error. L, L, L, +L, L, L, +L, L, +L, L, -L. +L, +L, +L. =head1 AUTHORS