diff options
author | Richard Jones <rjones@redhat.com> | 2010-04-19 14:41:01 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-04-19 15:08:45 +0100 |
commit | 3119aa687d4d594b50ee9df5ff6e8d709eb7ca85 (patch) | |
tree | f950fe7f4bce7b9795442b94e35afcef34159c66 /fish/guestfish.pod | |
parent | 819f30e332160ba05f7bf6dd068622cc07bf9ffc (diff) | |
download | libguestfs-3119aa687d4d594b50ee9df5ff6e8d709eb7ca85.tar.gz libguestfs-3119aa687d4d594b50ee9df5ff6e8d709eb7ca85.tar.xz libguestfs-3119aa687d4d594b50ee9df5ff6e8d709eb7ca85.zip |
fish: Allow -<<END as a syntax for uploading "heredocs".
For example:
><fs> upload -<<END /foo
some data
some more data
END
><fs> cat /foo
some data
some more data
Diffstat (limited to 'fish/guestfish.pod')
-rw-r--r-- | fish/guestfish.pod | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fish/guestfish.pod b/fish/guestfish.pod index e61d4e5b..836c4f7f 100644 --- a/fish/guestfish.pod +++ b/fish/guestfish.pod @@ -486,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<upload>, C<download>, C<tar-in>, C<tar-out> 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</foo> 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</PIPES>). + +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 -<<END /foo + input line 1 + input line 2 + input line 3 + END + +Any string of characters can be used instead of C<END>. The end +marker must appear on a line of its own, without any preceeding or +following characters (not even spaces). + +Note that the C<-E<lt>E<lt>> 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 |