Revision [249]
This is an old revision of CommandRedirect made by DavidLee on 2008-07-04 11:29:15.
IO Redirection
IO can be redirected as per the unix shells (sh) with "> file" , "< file" , "2> file".
Also Here Documents are supported for both text and XML documents.
Input Redirection
Using the syntax
command < file
Input for command is taken from the file "file" (either byte stream or Xml document).Output Redirection
Using the syntax
command > file
Output for command is passed to file "file" (either byte stream or Xml document).Stderr Redirection
Using the syntax
command 2> file
Stderr Output for command is passed to file "file" (either byte stream or Xml document).Here Documents
As per the unix shells, "Here Documents" are supported.A "here Document" is data embedded directly in the script or from the terminal which becomes the standard input of a command.
The syntax is:
command <<EOF Some Text Here until the magic "EOF" is found on a line by its own EOF
The tag "EOF" can be any string. Here documents work as well for text as xml documents.
For example:
xread doc <<EOF <foo> bar </foo> EOF
See Also BasicSyntax