Revision [1696]

Last edited on 2011-02-16 16:14:29 by DavidPriest [formatting error]
Additions:
command 2"">>"" file
Deletions:
command 2>> file


Revision [1515]

Edited on 2010-10-10 09:07:49 by DavidLee [formatting error]
Additions:
command 2>> file
Stderr Output for command is appended to file "file"


Revision [516]

Edited on 2009-05-13 13:00:20 by DavidLee [formatting error]
Additions:
Input and output can be explicitly bound to a [[NamedPorts Named Port]]. Named ports are specified by preceding the redirection symbol with (port). There are 3 predefined named ports, "input" , "output" , "error"
Deletions:
Input and output can be explicitly bound to [[NamedPorts Named Port]]. Named ports are specified by preceding the redirection symbol with (port). There are 3 predefined named ports, "input" , "output" , "error"


Revision [515]

Edited on 2009-05-13 12:34:00 by DavidLee [formatting error]
Additions:
====Variable Redirection====
A variable can be used for input or output redirection. The syntax is **{variable}** wherever a file would be used.
Example the following two commands are equivalent and send the result of xls into the variable "doc".
Variables can be //Appended//. This will turn a non-sequenced variable into a sequenced variable.
The one exception is that if the variable is initially empty, or contains a single atomic value, AND the output of the command is text then the appending works like appending to a file, that is the strings are concatenated.
====Port Redirection====
Input and output can be explicitly bound to [[NamedPorts Named Port]]. Named ports are specified by preceding the redirection symbol with (port). There are 3 predefined named ports, "input" , "output" , "error"
For example to bind the standard input port to "file.xml" and the port named "alternate" to "alternate.xml"
$ command (alternate)<alternate.xml <file.xml
The syntax 2< is synonymous with (error)< and 2> is synonymous with (error)>
For example, the following 2 commands are equivalent.
$ command 2>error.txt
$ command (error)>error.txt
Deletions:
====Ports====
A variable can be used for input or output redirection. This is called a "Port".
the syntax is {variable} wherever a file would be used.
Example the following two commands are equivilent
Ports can be //Appended//. This will turn a non-sequenced variable into a sequenced variable.
The one exception is that if the variable is initially empty, or contains a single atomic value,
AND the output of the command is text then the appending works like appending to a file,
that is the strings are concatenated.


Revision [514]

Edited on 2009-05-13 12:12:13 by DavidLee [formatting error]
Additions:
IO can be redirected as per the unix shells (sh) with "> file" , """>>""file" "< file" , "2> file". Redirection to variables and named ports, "Here Documents" and both text and XML documents are supported.
Deletions:
IO can be redirected as per the unix shells (sh) with "> file" , """>>""file" "< file" , "2> file".
Also Here Documents are supported for both text and XML documents.


Revision [424]

Edited on 2009-03-01 04:42:46 by DavidLee [formatting error]
Additions:
command "">>"" file
Deletions:
command >> file


Revision [423]

Edited on 2009-03-01 04:42:33 by DavidLee [formatting error]
Additions:
command >> file
Appends the output of command to file, creating file if it does not already exist.


Revision [422]

Edited on 2009-03-01 04:41:53 by DavidLee [formatting error]
Additions:
IO can be redirected as per the unix shells (sh) with "> file" , """>>""file" "< file" , "2> file".
Deletions:
IO can be redirected as per the unix shells (sh) with "> file" , """%gt;%gt;""; file" "< file" , "2> file".


Revision [421]

Edited on 2009-03-01 04:41:36 by DavidLee [formatting error]
Additions:
IO can be redirected as per the unix shells (sh) with "> file" , """%gt;%gt;""; file" "< file" , "2> file".
Deletions:
IO can be redirected as per the unix shells (sh) with "> file" , """%gt;%gt""; file" "< file" , "2> file".


Revision [420]

Edited on 2009-03-01 04:41:22 by DavidLee [formatting error]
Additions:
IO can be redirected as per the unix shells (sh) with "> file" , """%gt;%gt""; file" "< file" , "2> file".
Deletions:
IO can be redirected as per the unix shells (sh) with "> file" , "%gt;%gt; file" "< file" , "2> file".


Revision [419]

Edited on 2009-03-01 04:40:19 by DavidLee [formatting error]
Additions:
IO can be redirected as per the unix shells (sh) with "> file" , "%gt;%gt; file" "< file" , "2> file".
Deletions:
IO can be redirected as per the unix shells (sh) with "> file" , ">> file" "< file" , "2> file".


Revision [418]

Edited on 2009-03-01 04:39:53 by DavidLee [formatting error]
Additions:
IO can be redirected as per the unix shells (sh) with "> file" , ">> file" "< file" , "2> file".
The one exception is that if the variable is initially empty, or contains a single atomic value,
AND the output of the command is text then the appending works like appending to a file,
that is the strings are concatenated.
Text concatenation works when text mode commands are used.
$ echo foo >{port}
$ echo bar >>{port}
$ echo $port
foobar
Deletions:
IO can be redirected as per the unix shells (sh) with "> file" , "< file" , "2> file".


Revision [415]

Edited on 2009-02-06 05:25:15 by DavidLee [formatting error]
Additions:
====URL Input====
URL's can be used for input redirection any place a file is used.
For example
$ xcat < http://test.xmlsh.org/data/books.xml
Also any Internal or Builtin commands that take filenames will take URL's for input files.
For example the above can be rewritten without using redirection
$ xcat http://test.xmlsh.org/data/books.xml
In both cases, the Base URI of the resulting document is preserved.
Note that URL redirection can only be used for input, not for output at this time.
====Ports====
A variable can be used for input or output redirection. This is called a "Port".
the syntax is {variable} wherever a file would be used.
Example the following two commands are equivilent
$ xls >{doc}
$ xls | xread doc
And so are the following
$ xcat <{doc}
$ echo $doc | xcat
Ports can be //Appended//. This will turn a non-sequenced variable into a sequenced variable.
Example
$ xls >{doc}
$ xls >>{doc}
Now $doc is a sequence of 2 documents. The following would produce equivilent results
$ xls | xread doc
$ doc=<[$doc,$doc]>


Revision [249]

Edited on 2008-07-04 11:29:15 by DavidLee [formatting error]
Additions:
=====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
%%


Revision [247]

Edited on 2008-07-04 11:26:17 by DavidLee [formatting error]
Additions:
----
See Also [[BasicSyntax]]


Revision [243]

The oldest known version of this page was created on 2008-07-04 11:24:07 by DavidLee [formatting error]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki