Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Panel
Table of Contents



Creating In-Stream Data with the data Command

...

Anchor
1089330
1089330
The syntax for the data command is as follows:

<pre>
data [NAME|print=NAME] [resolve=all|defined|no] [end=ENDSEQUENCE]
[DATA]
end|ENDSEQUENCE
</pre>
Panel
Html bobswift


Anchor
1089334
1089334
Creating an In-Stream Data Element

...

Anchor
1089347
1089347
The end-of-data marker or end sequence marks the end of the data. By default, this is simply the word end. It must appear separately, on its own line. However, it is possible that end is valid instream data and you can change the end sequence with the end parameter of the data command.

 


Anchor
1089352
1089352
Example

Anchor
1089359
1089359
The following example shows how to use the data command in conjunction with the exec command to look through a series of copied files and display lines with the occurrence of some string under UNIX:

html-bobswift
Panel
<pre>
open remote=yourmachine user=someguy pwd=somepwd

data mydata resolve=all
grep "this is my sequence" $(_file)
exit
end

copy local=*.txt

forfiles remote=*.txt
   exec remote cmd=ksh input=mydata
end

close
</pre>


Anchor
1089374
1089374
Printing Data Element Information

...

Anchor
1089384
1089384
Continuing with the previous example, issuing:

<pre>
data print=mydata
</pre>
Panel
Html bobswift


Anchor
1089386
1089386
Will produce the following output:

<pre>
  ----> Begin 'mydata' <----
     grep "this is my sequence" $(_file)
     exit
  ---->  End 'mydata'  <----
</pre>
Panel
Html bobswift