Difference between revisions of "Recital"

From Recital Documentation Wiki
Jump to: navigation, search
 
(2 intermediate revisions by one user not shown)
Line 3: Line 3:
 
Additionally '''recital''' can be used in bash shell scripts and in shell commands which use pipes and/or redirect stdin and stdout. You can also use heredoc to denote a block of recital commands that should be executed. Note that when used in this manner, no UI commands can be executed and no user interaction is allowed.  
 
Additionally '''recital''' can be used in bash shell scripts and in shell commands which use pipes and/or redirect stdin and stdout. You can also use heredoc to denote a block of recital commands that should be executed. Note that when used in this manner, no UI commands can be executed and no user interaction is allowed.  
  
<code>
+
<pre>
 
# recital < mrprog.prg  
 
# recital < mrprog.prg  
 
# recital < myprog.prg > myoutput.txt
 
# recital < myprog.prg > myoutput.txt
Line 11: Line 11:
 
END
 
END
 
# echo "select * from sales!customers where overdue" | recital | wc -l
 
# echo "select * from sales!customers where overdue" | recital | wc -l
</code>
+
</pre>
  
Individual commands can be executed in shell scripts.
+
Individual commands can be executed in shell scripts by specifying the '''-c''' command line option.
  
<code>
+
<pre>
 
# recital -c "create database sales"
 
# recital -c "create database sales"
 
# recital -c "create table sales!invoices (id int, name char(25), due date)"
 
# recital -c "create table sales!invoices (id int, name char(25), due date)"
</code>
+
</pre>
  
Expressions can be evaluated and used in shell scripts.
+
Expressions can be evaluated and used in shell scripts by specifying the '''-e''' command line option.
  
<code lang="bash">
+
<pre>
 
# VER=`recital -e "version(1)"`
 
# VER=`recital -e "version(1)"`
</code>
+
</pre>
  
 
You can view what command line options are available by typing:
 
You can view what command line options are available by typing:
  
<code>
+
<pre>
 
# recital --help
 
# recital --help
</code>
+
</pre>

Latest revision as of 09:58, 26 October 2009

The recital command is used to run recital. By default if no redirection is specified typing recital will activate the recital workbench which is a character mode IDE which you can use to develop, test and debug recital applications.

Additionally recital can be used in bash shell scripts and in shell commands which use pipes and/or redirect stdin and stdout. You can also use heredoc to denote a block of recital commands that should be executed. Note that when used in this manner, no UI commands can be executed and no user interaction is allowed.

# recital < mrprog.prg 
# recital < myprog.prg > myoutput.txt
# recital > myoutput.txt <<END 
use customers
list structure
END
# echo "select * from sales!customers where overdue" | recital | wc -l

Individual commands can be executed in shell scripts by specifying the -c command line option.

# recital -c "create database sales"
# recital -c "create table sales!invoices (id int, name char(25), due date)"

Expressions can be evaluated and used in shell scripts by specifying the -e command line option.

# VER=`recital -e "version(1)"`

You can view what command line options are available by typing:

# recital --help