Solved

setup shell script

Posted on 1998-05-18
3
248 Views
Last Modified: 2013-12-15
I'm trying to work out exactly how my slakware system logs in to my ISP. In my /usr/sbin directory, there's a small bash script called ppp-on; it contains the following function:

function initialize
{
    chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK'
    return
}

Could someone explain what each part of this script does?

Thanks,

David King
ventnor@psinet.net.au
0
Comment
Question by:vexil
  • 2
3 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 100 total points
ID: 1627196
chat -v TIMEOUT 3 '' AT 'OK-+++\c-OK'
     ^^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
     |  |set    | |__ chat script __|
     |  |timeout|
     |  |to 3sec|
     |  |for nxt|
     |  |expect |
     |  |string |
     |  +-------+_
     \--- erbose mode of chat script

The chat script is given as command line parameters, it reads as follows:
    ''     expect (wait for) nothing
    AT     send  AT  command
    OK     expect  OK
    +++\c  send +++ (without a newline)
           this command usualy aborts all modem actions
    OK     expect  OK
0
 

Author Comment

by:vexil
ID: 1627197
Thanks, ahoffmann!
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 1627198
e-e did reformat my answer, but you understand anyway ;-)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question