Why does ppp(8) ignore the \ character in my chat script?

Ppp parses each line in your config files so that it can interpret strings such as set phone "123 456 789" correctly and realize that the number is actually only one argument. In order to specify a " character, you must escape it using a backslash (\).

When the chat interpreter parses each argument, it re-interprets the argument in order to find any special escape sequences such as \P or \T (see the man page). As a result of this double-parsing, you must remember to use the correct number of escapes.

If you wish to actually send a \ character to (say) your modem, you would need something like:

    set dial "\"\" ATZ OK-ATZ-OK AT\\\\X OK"

resulting in the following sequence:

    ATZ
    OK
    AT\X
    OK

or

    set phone 1234567
    set dial "\"\" ATZ OK ATDT\\T"

resulting in the following sequence:

    ATZ
    OK
    ATDT1234567


UNIXguide.net
Suggest a Site