File: onliner.html

package info (click to toggle)
librnd 4.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,812 kB
  • sloc: ansic: 126,990; sh: 2,602; makefile: 2,145; awk: 7
file content (19 lines) | stat: -rw-r--r-- 849 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
The <act>oneliner</act> action is designed for quick execution of short,
trivial scripts, such as a for loop for repeating an action. It supports
any scripting language currently availabel through fungw. Each oneliner is
an independent script context - variables, functions and other global states
do not persist.
<p>
This group of actions offers three forms:
<ul>
	<li> <act>oneliner</act>(<arg>lang</arg>, <arg>script</arg>) - execute the script in the language specified
	<li> lang(script) - shorthand for the above
	<li> lang - switch the command line interpreter to execute one-liners in the given language, until /exit
</ul>
<p>
For example, a simple calculation using awk can be done in three ways:
<ul>
	<li> <i>oneliner(awk, 'print 42*3')</i>
	<li> <i>awk('print 42*3')</i>
	<li> <i>awk</i>, then <i>print 42*3</i>, then <i>/exit</i>
</ul>