6.

contents
Next: The print Command Up: A dip Reference Previous: echo and term

The get Command

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:

            DIP> get $local ask            Enter the value for $local:  

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:

  wait address: 10 get $locip remote 

Andrew Anderson
Thu Mar 7 23:22:06 EST 1996



The Network Administrators' Guide
Linux Network Administrators Guide (2nd Edition)
ISBN: B00007FYJC
EAN: N/A
Year: 1992
Pages: 296

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net