Библиотека сайта rus-linux.net
Next: Alternates Up: How to Tell UUCP Previous: Port and Speed
Above, we already encountered the login chat script, which tells uucico how to log into the remote system. It consists of a list of tokens, specifying strings expected and sent by the local uucico process. The intention is to make uucico wait until the remote machine sends a login prompt, then return the login name, wait for the remote system to send the password prompt, and send the password. Expect and send strings are given in alternation. uucico automatically appends a carriage return character (r) to any send string. Thus, a simple chat script would look like
You will notice that the expect fields don't contain the whole prompts. This is to make sure that the login succeeds even if the remote system broadcasts Login: instead of login:.
uucico also allows for some sort of conditional execution, for example in the case that the remote machine's getty needs to be reset before sending a prompt. For this, you can attach a sub-chat to an expect string, offset by a dash. The sub-chat is executed only if the main expect fails, i.e. a timeout occurs. One way to use this feature is to send a BREAK if the remote site doesn't display a login prompt. The following example gives an allround chat script that should also work in case you have to hit return before the login appears. tells UUCP to not wait for anything and continue with the next send string immediately.
There are a couple of special strings and escape characters which may occur in the chat script. The following is an incomplete list of characters legal in expect strings:
On send strings, the following escape characters and strings are legal in addition to the above:
Next: Alternates Up: How to Tell UUCP Previous: Port and Speed Andrew Anderson
Thu Mar 7 23:22:06 EST 1996