Tera Term Macro Examples

Tera Term is easily one of the most powerful free Terminal Emulation Software that I have come across and the power of it lies in its scripting language TTL. Of-course, it is not as extensive and capability rich as Perl but for a non-programmer, a browse through a single help file on TTL language is all it takes to create wonderful scripts that could make his/her life easier in maintaining huge networks.
The capabilities are limitless and if you could find better ways of enhancing the following script, please come forward and do your bit.
Tera Term Macro Examples

The purpose of the script is for terminal configuration of repetitive commands in multiple terminal enabled devices at once but sequentially without human intervention.

Today I installed Tera Term 4.67 and tried the new dispstr macro function. I believe there is a bug. I found that the connect command must return a result of 2 in order for dispstr to work. Even though a result of 1 from connect is enough to link the macro to a TeraTerm console, dispstr will not display the string. For more detail, remotelyI wrote a Tera Term macro to connect to a serial port. Note '/C=1' his explanation Feedback x Tell us about your experience. This is more of a 'brain dump' to help other people process of setting up the connection somewhat easier by creating a pair of appropriate shortcuts. PC based Tera-term macro or Python script example to send a “GET” using DNS lookup to a HTTP Server. Down load Tera Term Connect the eS-Wifi module to the PC Setup the comm port and Tera Term terminal with Transmit and Receive with CR+LF.

The other purpose of the script is to fetch terminal information from multiple terminal enabled devices at once but sequentially without human intervention.

The script is primarily designed for working with Cisco devices which can be configured using terminal emulation and which has a Command Line Interface (CLI).

The execution of the script requires Tera Term Software installed on the user’s computer. The Tera Term software can be downloaded from the following URL:

http://hp.vector.co.jp/authors/VA002416/teraterm.html

The Procedure for execution of the script is as follows:

  • Download Tera Term from the above mentioned URL.
  • Unzip and downloaded file and execute the Setup.exe file.
  • Install the Software in a specified destination.
  • Copy the below provided script in the Tera Term directory.
  • The script has an extension of .TTL and can be opened in notepad.
  • Open the file in notepad and change the variable ‘dirname’ in the script to reflect your Tera Term Directory.
  • Make two Text Files in the directory specified by the variable ‘dirname’ by the following names:

ip.txt

commands.txt

  • Make sure you have telnet access to all the devices you would like to configure.
  • Open the ip.txt file and enter the IP addresses of all the devices for which the configuration needs to be fetched or pushed. Place only one IP address per line.
  • Open the commands.txt file and enter the commands for configuration or commands for fetching configuration from the devices. Please note that the commands need to be compatible on all the devices entered in the ip.txt file. Please put in the commands in sequential order as you would configure the device in the normal circumstances. For eg:

terminal length 0

show running-config

config t

enable secret cisco

exit

terminal length 24

write memory

  • Please place the commands that are required after authentication is done. The script expects a device prompt (which can be customized easily) by default after authentication. You may change it at any point of time.
  • Execute the file ttpmacro.exe present in the Tera Term directory and select the macro '.ttl’ extension.
  • Please enter the Username for logging into the devices and press OK. Please note the Username and Password prompt would appear only once. The same username and password would be used to login into all the devices.
  • Please enter the password in the Password Prompt Dialog Box and press OK.
  • For Enable Password Authentication Prompt, click yes if you have enable password authentication configured in atleast some of the devices or click no if you don’t have enable password configured in any of the devices.
  • If yes, then provide the enable password to log into all the devices. The password is assumed to be common on all the devices.
  • For the Logging Dialog Box. Click yes if you want to log the output or click no if you don’t want to log the output.
  • If yes, enter the directory in which the logs have to be placed. For eg: If the directory is ‘C:logs’ then enter it in the following format:

c:logs

  • Please note that the ‘’ sign is important after you enter the directory path and name.
  • Sit back and relax, as the commands entered in the commands.txt file is executed in every device entered in ip.txt.

P.S.: While fetching configuration from any device like that of Cisco, please make sure to keep the terminal length to zero so that the device prompt appears immediately after the execution of the command.

Run Tera Term Macro File

Please give your feedbacks to make it better.


Below is the script for use with Tera Term. Just copy & paste the below code in a notepad and save it with a TTL extension.
;#######################################################
;Version 3.2 (Untested Beta Version)
;Created on 25/03/2007
;For Tera Term Macro Use Only
;Created originally for Cisco Switch & Routers.
;Customizable script, please feel free to edit it.(In fact you have to edit it)
;For usage, execute ttpmacro.exe and select this script
;Write all the ip addresses in sequential order in a file by the name of 'ip.txt'
;Write all the commands in sequential order in a file by the name of 'commands.txt'
;and place the text files in the directory as set by the 'setdir' keyword.
;Complaints and suggestions for improvement welcome.
;Please feel free to take it to the next level and share it with others.
;#######################################################
;######################################################
;Main Script
;######################################################
timeout = 5
dirname = 'E:Program FilesTTERMPRO313'
setdir dirname
fileopen addressfile 'ip.txt' 0
inputbox 'Username:' 'Username Prompt'
Username = inputstr
passwordbox 'Password:' 'Password Prompt'
Password = inputstr
yesnobox 'Is enable password authentication required?' 'Enable Password Question'
if result=0 then
goto jumper1
endif
passwordbox 'Enable Password:' 'Enable Password Prompt'
Enable = inputstr
:jumper1
yesnobox 'Would you like to log the output?' 'Logging'
Logger = result
if Logger = 0 then
goto looper1
endif
inputbox 'Directory path & name followed by ' 'Logging Directory'
loggerpath = inputstr
dirmaker = 'cmd /C md '
strconcat dirmaker loggerpath
exec dirmaker
:looper1
filereadln addressfile ip
connect ip
if result = 1 then
goto fclose1
endif
wait 'Username:' 'Password:' '>' 'login:'
if result = 0 then
call terminator
goto looper1
elseif result = 1 then
goto jumper4
elseif result = 2 then
goto jumper5
elseif result = 3 then
goto jumper6
elseif result = 4 then
goto jumper4
endif
:jumper4
sendln Username
wait 'Password:'
:jumper5
sendln Password
if Logger = 0 then
goto jumper2
endif
loggerfile = loggerpath
strconcat loggerfile ip
logopen loggerfile 0 0
loggerfile = '
:jumper2
wait '#' '>'
if result = 0 then
call terminator
elseif result = 1 then
call commander
call terminator
elseif result = 2 then
:jumper6
call enabler
call commander
call terminator
endif
goto looper1
:fclose1
fileclose addressfile
closett
end
;################################################
;Enabler is a sub-routine which provides enable password authentication.
;################################################
:enabler
setdir dirname
sendln 'enable'
wait 'Password:'
sendln Enable
return
;#####################################
;Commander is a sub-routine which executes the
;commands placed in 'commands.txt' file
;#####################################
:commander
setdir dirname
fileopen commandfile 'commands.txt' 0
:looper2
filereadln commandfile statement
if result goto fclose2
sendln statement
wait '#' '>'
if result = 2 then
goto fclose2
endif
goto looper2
:fclose2
fileclose commandfile
return
;###########################################
;Terminator is a sub-routine which provides terminal closure and
;passing the control to the main sub-routine for loop completion.
;###########################################
:terminator
beep
if Logger = 0 then
goto jumper3
endif
logclose
:jumper3
closett
return
;###########################################

TeraTerm Macro language for dummies. A common use that I have for the wait/sendln pair is to send a series of commands to a machine. For example, when sending a series of commands to a Linux box, it might look something like the following. Example messagebox ErrorMessage 'Error' message='First line nSecond line nThird line nFourth line nFifth line n' strspecial message messagebox message title variable = 99 sprintf2 msg '%d' variable messagebox msg 'variable ='.

Contents • • • • • • History [ ] The first versions of Tera Term were created by T. Teranishi from Japan. At the time, it was the only freely available terminal emulator to effectively support the Japanese language. Original development of Tera Term stopped in the late 1990s at version 2.3, but other organizations have created variations. In October 2002, Ayera Technologies released TeraTerm Pro 3.1.3 supporting SSH2 and added multiple other features like a built-in for integration with external systems, recurring 'keep-alive' commands, and database support via the TT Macro Scripting Language. Ayera Technologies did not make their source open, but does provide limited technical support. In 2004, Yutaka Hirata, a software designer from Japan, restarted development of the open source version of Tera Term.

13 Pembelajaran berbasis keterampilan proses sains menekankan pada kemampuan siswa dalam menemukan sendiri (discover) pengetahuan yang didasarkan atas pengalaman belajar, hukum-hukum, prinsip-prinsip. Keterampilan proses, dan strategi keterampilan proses. Setelah pembahasan keempat topik tersebut, maka mahasiswa diharapkan: 1. Memiliki pemahaman tentang pentingnya pembelajaran keterampilan proses; 2. Memiliki pemahaman tentang ragam keterampilan siswa melalui pembelajaran keterampilan proses; 3.

Tera Term Macro Examples

He added his own implementation of SSH2 and many new features on top of what was part of version 2.3. A complete list of them is published on TeraTerm Document. To avoid confusion with version numbers and to indicate that Tera Term developed by Yutaka was more recent than version 3.1.3 from Ayera Technologies, it was decided to give this branch of Tera Term Professional version numbers starting 4.xx. In January 2005, Boris Maisuradze, together with Yutaka Hirata, started the TeraTerm Support forum where they answer questions from Tera Term users. Posting in this forum is the best way to suggest new features for Tera Term or propose new commands for the Tera Term Macro language.

Since 2007, Tera Term has been maintained by Tera Term Project (Japanese Developer team) as open source software. Tera Term has comparable features to. Common versions [ ] • 1.4 Last version supporting Win16; source available in • 2.3 Last version released by T.

Tera Term Macro

Teranishi • 3.1.3 Last version released by Ayera. Has issues with scroll window boundaries. Title bar identifies it as version 3.1 • 4.xx Latest OSDN release Sample images [ ] •.

Messagebox messagebox Displays a dialog box with message. Messagebox [] Parameters string It is displayed in the dialog box. Extremez ip serial number.

String It is displayed as the dialog box title. Integer (optional default=0) If it is non-zero, following strings in is treated as spacial character. Input output ' ' n line feed t tab This option is obsolete. You are recommended to use the strspecial command.

Example messagebox ErrorMessage 'Error' message='First line nSecond line nThird line nFourth line nFifth line n' strspecial message messagebox message title variable = 99 sprintf2 msg '%d' variable messagebox msg 'variable =' See also •.