Options

how to learn TCL scripting (beginner)

SysnetNotesSysnetNotes Member Posts: 45 ■■□□□□□□□□
While searching through the job boards,I saw many position saying knowledge in Scripting (TCL) will be an added advantage.I dont have any programming background.Is that easy to learn scripting without a programming background?. Is there anyone here to tell basics of TCL Scripting or pointing to some websites or PDFs to learn it.I did a google search,but most of the websites seems bit complex for a beginner

Comments

  • Options
    DevilWAHDevilWAH Member Posts: 2,997 ■■■■■■■■□□
    Tcl is a nice logical language.

    I learnt it by the expect route. Expect is a nice extension to tcl for automating tasks. Look up expect tcl on Wikipedia for a simple code example. But if you deal with remote console access and you want to learn tcl, it is a good way to get practical experience. There's loads of codeine examples around starting from the very basic like below
    # Assume $remote_server, $my_user_id, $my_password, and $my_command were read in earlier# in the script.
    # Open a telnet session to a remote server, and wait for a username prompt.
    spawn telnet $remote_server
    expect "username:"
    # Send the username, and then wait for a password prompt.
    send "$my_user_id\r"
    expect "password:"
    # Send the password, and then wait for a shell prompt.
    send "$my_password\r"
    expect "%"
    # Send the prebuilt command, and then wait for another shell prompt.
    send "$my_command\r"
    expect "%"
    # Capture the results of the command into a variable. This can be displayed, or written to disk.
    set results $expect_out(buffer)
    # Exit the telnet session, and wait for a special end-of-file character.
    send "exit\r"
    expect eof
    • If you can't explain it simply, you don't understand it well enough. Albert Einstein
    • An arrow can only be shot by pulling it backward. So when life is dragging you back with difficulties. It means that its going to launch you into something great. So just focus and keep aiming.
Sign In or Register to comment.