50 lines
1.6 KiB
HTML
50 lines
1.6 KiB
HTML
|
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||
|
<!--Converted with LaTeX2HTML 96.1-c (Feb 29, 1996) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds -->
|
||
|
<HTML>
|
||
|
<HEAD>
|
||
|
<TITLE>The get Command</TITLE>
|
||
|
|
||
|
|
||
|
</HEAD>
|
||
|
<BODY LANG="EN">
|
||
|
<A HREF="node1.html"><IMG WIDTH=65 HEIGHT=24 ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <BR>
|
||
|
<B> Next:</B> <A HREF="node101.html">The print Command</A>
|
||
|
<B>Up:</B> <A HREF="node97.html">A dip Reference</A>
|
||
|
<B> Previous:</B> <A HREF="node99.html">echo and term</A>
|
||
|
<BR> <P>
|
||
|
<H3><A NAME="SECTION009323000">The get Command</A></H3>
|
||
|
<P>
|
||
|
The get command is dip's way of setting a variable.
|
||
|
The simplest form is to set a variable to a constant, as used
|
||
|
|
||
|
throughout the above example. You may, however, also prompt the
|
||
|
user for input by specifying the keyword ask instead
|
||
|
of a value:
|
||
|
<P>
|
||
|
<pre>
|
||
|
DIP> get $local ask
|
||
|
Enter the value for $local:
|
||
|
</pre>
|
||
|
<P>
|
||
|
A third method is to try to obtain the value from the remote host.
|
||
|
Bizarre as it seems first, this is very useful in some cases:
|
||
|
Some SLIP servers will not allow you to use your own IP-address on the
|
||
|
SLIP link, but will rather assign you one from a pool of addresses
|
||
|
whenever you dial in, printing some message that informs you about
|
||
|
the address you have been assigned. If the message looks something
|
||
|
like this ``Your address: 193.174.7.202'', then the following
|
||
|
piece of dip code would let you pick up the address:
|
||
|
<P>
|
||
|
<pre>
|
||
|
wait address: 10
|
||
|
get $locip remote
|
||
|
</pre>
|
||
|
|
||
|
<HR>
|
||
|
<P><ADDRESS>
|
||
|
<I>Andrew Anderson <BR>
|
||
|
Thu Mar 7 23:22:06 EST 1996</I>
|
||
|
</ADDRESS>
|
||
|
</BODY>
|
||
|
</HTML>
|