summaryrefslogtreecommitdiffstats
path: root/guestfish.pod
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-06-27 15:00:48 +0200
committerRichard W.M. Jones <rjones@redhat.com>2009-06-28 22:22:30 +0100
commit88da5cf8a32e683ed1d78419fcde609a389a2f65 (patch)
treed5ba4eace6c03ef8374c2d9394711ae724f744cf /guestfish.pod
parentd164ae963297a99e2222bc32b11928c1635c45d8 (diff)
downloadlibguestfs-88da5cf8a32e683ed1d78419fcde609a389a2f65.tar.gz
libguestfs-88da5cf8a32e683ed1d78419fcde609a389a2f65.tar.xz
libguestfs-88da5cf8a32e683ed1d78419fcde609a389a2f65.zip
Guestfish pipes.
Diffstat (limited to 'guestfish.pod')
-rw-r--r--guestfish.pod26
1 files changed, 26 insertions, 0 deletions
diff --git a/guestfish.pod b/guestfish.pod
index 0870b9ee..26312fe4 100644
--- a/guestfish.pod
+++ b/guestfish.pod
@@ -282,6 +282,32 @@ will create a directory C<local> on the host, and then export
the contents of C</remote> on the mounted filesystem to
C<local/remote-data.tar.gz>. (See C<tgz-out>).
+=head1 PIPES
+
+Use C<command E<lt>spaceE<gt> | 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<cat> is the guestfish cat command, but C<awk> 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