X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=guestfish.pod;h=26312fe4b68cf20693f137c0a6f90e3f7b645707;hp=0870b9ee88e33dc5be48c463049f210cf6f0cf9e;hb=88da5cf8a32e683ed1d78419fcde609a389a2f65;hpb=d164ae963297a99e2222bc32b11928c1635c45d8 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