Difference between revisions of "Recital"

From Recital Documentation Wiki
Jump to: navigation, search
Line 1: Line 1:
 
{{YLM to do}}
 
{{YLM to do}}
  
Recital 9.6 enhanced Recital by enabling it to be used in bash shell scripts and in shell commands which use pipes and/or redirect stdin and stdout. If stdin is not redirected then recital will startup and operate as normal in a terminal window. Additionally you can 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 10 enhanced Recital by enabling it to be used in bash shell scripts and in shell commands which use pipes and/or redirect stdin and stdout. If stdin is not redirected then recital will startup and operate as normal in a terminal window. Additionally you can 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 lang="recital">
 
# recital < mrprog.prg  
 
# recital < mrprog.prg  
 
# recital < myprog.prg > myoutput.txt
 
# recital < myprog.prg > myoutput.txt
Line 10: 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>
  
 
Individual commands can be executed in shell scripts.
 
Individual commands can be executed in shell scripts.
  
 +
<code lang="recital">
 
# 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>
  
 
Expressions can be evaluated and used in shell scripts.
 
Expressions can be evaluated and used in shell scripts.
  
 +
<code lang="recital">
 
# VER=`recital -e "version(1)"`
 
# VER=`recital -e "version(1)"`
 +
</code>
  
 
You can view what command line options are available by typing:
 
You can view what command line options are available by typing:
  
 +
<code lang="recital">
 
# recital --help
 
# recital --help
 +
</code>

Revision as of 09:43, 26 October 2009

Template:YLM to do

Recital 10 enhanced Recital by enabling it to be used in bash shell scripts and in shell commands which use pipes and/or redirect stdin and stdout. If stdin is not redirected then recital will startup and operate as normal in a terminal window. Additionally you can 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.

# 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.

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

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

# recital --help