Библиотека сайта или "Мой Linux Documentation Project"
Next: The print Command Up: A dip Reference Previous: echo and term
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: 220.127.116.11'', then the following piece of dip code would let you pick up the address:
wait address: 10 get $locip remote
Thu Mar 7 23:22:06 EST 1996
Только зарегистрированные пользователи могут оценивать и комментировать статьи.