Книга: Linux Network Administrator Guide, Second Edition

The get command

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 we did in cowslip.dip. 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 obtain the value from the remote host. Bizarre as it seems at 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 " Your address: 192.168.5.74 ", the following piece of dip code would let you pick up the address:

# finish login
wait address: 10
get $locip remote

Оглавление книги


Генерация: 0.563. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз