📄 setup.html
字号:
REBOL/Core to any other location on your disk because it has no
installation "hooks" to worry about. In addition, to copy REBOL
to another computer, you can simply copy the executable file.</p>
</blockquote>
<h3 id="section-2.3">2.3 Distribution Files</h3>
<blockquote>
<p>The REBOL/Core distribution archive includes these files:</p>
<table cellspacing="6" border="0" width="95%">
<tr><td width="20"> </td><td valign="top" width="80"><b>license.txt</b></td><td valign="top">A copy of the end user license agreement.
</td></tr>
<tr><td width="20"> </td><td valign="top" width="80"><b>rebol(.exe)</b></td><td valign="top">The REBOL/Core executable program.
</td></tr>
<tr><td width="20"> </td><td valign="top" width="80"><b>rebol.r</b></td><td valign="top">A file that contains additional changes or patches to
REBOL, if necessary. This file is not strictly required to run
REBOL, but if it exists when REBOL starts, it will automatically
be loaded. Note that in more recent releases, this file may be
empty.
</td></tr>
<tr><td width="20"> </td><td valign="top" width="80"><b>setup.html</b></td><td valign="top">This document about getting started with REBOL/Core.
</td></tr>
<tr><td width="20"> </td><td valign="top" width="80"><b>setup.r</b></td><td valign="top">A script that you can run to prompt you for your
network setup configuration. This script creates a user.r file
as a result (that is automatically loaded each time you run
REBOL/Core).
</td></tr>
<tr><td width="20"> </td><td valign="top" width="80"><b>words.r</b></td><td valign="top">A small script that builds an HTML summary sheet for
all REBOL function words. This is provided as an example script.
After running this script, open the words.html file with your
web browser to view the results.
</td></tr>
</table>
</blockquote>
<h3 id="section-2.4">2.4 Running From an Icon</h3>
<blockquote>
<p>REBOL can be started by clicking on the REBOL program icon or a
shortcut to the program icon.</p>
<p><I>Note that because REBOL/Core has no Windows installer, it
does not automatically associate .r files to run REBOL. However,
you can easily add your own .r file association. In any folder
window, click on the View Folder Options menu and select File
Types to add it.</I></p>
<p>Once you have started REBOL, you can run scripts from its
command prompt using the DO function. For example:</p>
<pre>
do %script.r
</pre>
<p>would run the script.r file. Do not forget the % to indicate that
it is a file.</p>
<p>Here is another example that would run a script from a web site:</p>
<pre>
do http://www.example.com/script.r
</pre>
<p>If in Windows (or other systems) you want to create a shortcut
icon that automatically runs a specific REBOL script, follow the
instructions for Running From a Shell described below.</p>
</blockquote>
<h3 id="section-2.5">2.5 Running From a Shell</h3>
<blockquote>
<p>REBOL can be started from the command line with a variety of
options and arguments. To view a summary, start REBOL and type:</p>
<pre>
usage
</pre>
<p>at the REBOL prompt. Or, run REBOL with the option:</p>
<pre>
REBOL -?
</pre>
<p>The format of the REBOL command line is:</p>
<pre>
REBOL [options] [script] [args]
</pre>
<p>All of these arguments are optional. They are:</p>
<pre>
Options -- one or more options as listed below
Script -- a script file to run
Args -- arguments passed to the script
</pre>
<p>Typically, you will provide REBOL with the name of the script
file that you want to evaluate. For instance, to run a script
called script.r, type:</p>
<pre>
REBOL script.r
</pre>
<p>To run the script with an option, such as the -s option that
lowers the security level, write a line such as:</p>
<pre>
REBOL -s script.r
</pre>
<p>The dash (-) is used for single-character options. A double dash
(--) is used for a full-word options. This is standard practice
in many operating systems. For instance, to obtain usage
information about REBOL, you can type either of these lines:</p>
<pre>
REBOL -?
REBOL --help
</pre>
<p>When the script name is followed by additional words and
values, they are passed to the script as arguments. The
arguments are passed to the script in the SYSTEM/SCRIPT
object. For example, the command line arguments:</p>
<pre>
REBOL script.r test 1234
</pre>
<p>can be printed with a line such as:</p>
<pre>
probe system/script/args
</pre>
<p>If no script arguments are provided, a NONE is returned.</p>
<p>You can also use a "--" followed by no word to signal the end of
command line and pass remaining values to REBOL as script
arguments:</p>
<pre>
REBOL -- example 1234
</pre>
<p>Because no script file is provided in this example, it is
assumed that you have a default script specified in your user.r
file. See below.</p>
<p>More about starting REBOL can be found in the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-2.html"><B>Operation
Chapter</B></A> of the <I>REBOL/Core User's Guide</I>.</p>
</blockquote>
<h3 id="section-2.6">2.6 Running in CGI Mode</h3>
<blockquote>
<p>When you use REBOL for CGI scripts, you will need to provide a
special -c option to tell REBOL to read the CGI environment
variables. For example, the line below:</p>
<pre>
REBOL -c cgi-script.r
</pre>
<p>runs the script in CGI mode.</p>
<p>If you also want to run your REBOL CGI script so it can write
output files, you will need to lower the default security with
the -s option. This command does the job:</p>
<pre>
REBOL -cs cgi-script.r
</pre>
<p>For many types of web servers (such as Apache), you can create
CGI shell scripts that include both the command line and the
script itself. Here is an example of how it is done:</p>
<pre>
#!/home/user/rebol -cs
REBOL [Title: "CGI Script"]
print "content-type: text/html^/"
print [
<HTML><BODY>
"Now is:" now
<PRE>
mold system/options/cgi
</PRE>
</BODY></HTML>
]
</pre>
<p>When accessed from a web browser via CGI, this example will
print the date and time followed by the CGI environment object
(which lets you see all the information that the web server has
passed to you.)</p>
<p>Be sure that the script and REBOL have the necessary permissions
for your operating system (e.g. Unix file mode 755).</p>
<p>More about CGI operation can be found in the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-13.html"><B>Networking
Chapter</B></A> of the <I>REBOL/Core User's Guide</I>.</p>
</blockquote>
<h3 id="section-2.7">2.7 Startup Scripts</h3>
<blockquote>
<p>When REBOL starts it will automatically run the rebol.r and
user.r files, if they exist.</p>
<p>The system looks for these files first in the current directory
(or the directory of the script being run), then in the
directory that contains the REBOL executable program.</p>
<p><I>Note that REBOL/Core runs fine without the rebol.r and user.r
files. They simply provide an easy way to include additional
code and data on startup, such as your network preferences.</I></p>
</blockquote>
<h3 id="section-2.8">2.8 Script Security</h3>
<blockquote>
<p>REBOL stays on the safe side by not allowing scripts to modify
or delete files unless you let them.</p>
<p>In addition, REBOL offers a variety of security settings that
control file and network security, including file and directory
"sandboxes" (areas where scripts are permitted to access files).</p>
<p>In REBOL/Core the default security lets scripts only
modify or delete files in the script's current directory,
<I>nowhere else</I>. Changing files anywhere else requires user
approval.</p>
<p>For trusted scripts, you can run REBOL with security disabled.
This mode lets scripts do anything (including delete files). To
run in this mode, start REBOL with the -s option:</p>
<pre>
REBOL -s script.r
</pre>
<p>When running this way, be sure to <B>only run scripts that you
have written or scripts that you trust completely</B>.</p>
<p>If you want to run scripts with full security for read and
write, you can specify the +s command option:</p>
<pre>
REBOL +s script.r
</pre>
<p>Now REBOL will prompt you each time your script tries to do
anything, including simply reading a file.</p>
<div class="note"><p><b>Security Warning</b></p>
<p>Note that only you, the user, can change the security.</p>
<p>When running REBOL, if you receive a security warning, <B>do not
approve a change of security or allow file operations if you do
not trust the script</B>. Inspect the script first before
running it or obtain the script from a trusted source.</p>
<p>There is no way for a script to lower the security level without
your approval. Changes can only be made from the command line
(with options like -s, +s, and --secure) or from the popup
security warning.</p>
</div>
<p>See the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-2.html"><B>Operation
Chapter</B></A> of the <I>REBOL/Core User's Guide</I> for more
information about security.</p>
</blockquote>
<h3 id="section-2.9">2.9 Quitting REBOL</h3>
<blockquote>
<p>You can quit REBOL at any time by typing:</p>
<pre>
quit
</pre>
<p>or just:</p>
<pre>
q
</pre>
<p>Note that typing the word EXIT will result in an error message,
because EXIT is a word used to return from REBOL functions.</p>
<p>If your script was run in CGI mode, it will automatically
quit when it has finished.</p>
</blockquote>
<h2 id="section-3">3. Network Setup</h2>
<blockquote>
<p>If your computer has direct access to the Internet, then you can
run REBOL/Core without any network setup.</p>
<p>If your computer uses a proxy server to access the Internet, you
will need to provide settings to allow REBOL to make connections
through the proxy.</p>
<p>If you want to use the SMTP email protocol (for example, use the
SEND function to send email), you need to provide a reply
address and mail server name.</p>
<p>Network setup can be provided in each script that you run or in
your user.r file that is loaded each time you run REBOL. Both
methods have their advantages.</p>
</blockquote>
<h3 id="section-3.1">3.1 Basic Concepts</h3>
<blockquote>
<p>REBOL provides the SET-NET function to make it easy to specify
your email and network settings.</p>
<p>For example, within a script you can use:</p>
<pre>
set-net [user@example.com mail.example.com]
</pre>
<p>to set your email reply address and the name of your SMTP email
server.</p>
<p>Set-net can also set your POP and proxy server information.
See more below.</p>
<p>Note that SET-NET is just a shortcut function for quick setup.
Many other network setup parameters are available, such as
network timeouts for each protocol.</p>
<p>See the <A
HREF="http://www.rebol.com/docs/core23/rebolcore-13.html"><B>Networking
Chapter</B></A> of the <I>REBOL/Core User's Guide</I> for full
details.</p>
</blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -