X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=guestfish.pod;h=26312fe4b68cf20693f137c0a6f90e3f7b645707;hb=5af058b7d02607dcbcfb8f561cc0b8fec9a7d305;hp=0870b9ee88e33dc5be48c463049f210cf6f0cf9e;hpb=efdf252102a65b691e405f80de4261dfc8a0035b;p=libguestfs.git diff --git a/guestfish.pod b/guestfish.pod index 0870b9e..26312fe 100644 --- a/guestfish.pod +++ b/guestfish.pod @@ -282,6 +282,32 @@ will create a directory C on the host, and then export the contents of C on the mounted filesystem to C. (See C). +=head1 PIPES + +Use CspaceE | command> to pipe the output of the +first command (a guestfish command) to the second command (any host +command). For example: + + cat /etc/passwd | awk -F: '$3 == 0 { print }' + +(where C is the guestfish cat command, but C is the host awk +program). The above command would list all accounts in the guest +filesystem which have UID 0, ie. root accounts including backdoors. +Other examples: + + hexdump /bin/ls | head + list-devices | tail -1 + +The space before the pipe symbol is required, any space after the pipe +symbol is optional. Everything after the pipe symbol is just passed +straight to the host shell, so it can contain redirections, globs and +anything else that makes sense on the host side. + +To use a literal argument which begins with a pipe symbol, you have +to quote it, eg: + + echo "|" + =head1 EXIT ON ERROR BEHAVIOUR By default, guestfish will ignore any errors when in interactive mode