Книга: 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
- Basics of the iptables command
- MIRROR target
- Testing the Project
- 5.1.1 Make Targets
- Getting Around Fedora
- Getting started with the Backup Command-Line utility
- 2.1.3. Функция getopt_long()
- 4.4.4 The Dispatcher
- About the author
- Chapter 7. The state machine
- Chapter 11. Iptables targets and jumps
- Appendix A. Detailed explanations of special commands