0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

TeraTerm TTL 備忘録

Posted at

SSHログイン

;ログイン情報
USERNAME = 'ユーザ名'  
PASSWORD = 'パスワード' 
HOSTADDR = 'IPアドレス'

;ログインコマンド生成
cmd = HOSTADDR
strconcat LoginCmd ' /ssh /auth=password /user='
strconcat LoginCmd USERNAME
strconcat LoginCmd ' /passwd='
strconcat LoginCmd PASSWORD

;ログイン
connect LoginCmd

参考文献

ログイン後 コマンド送信

;ログイン待ち
wait ']#'

;コマンド送信(変数なし)
sendln 'pwd'

;コマンド送信(変数有り)
cmd1 = 'echo '
strconcat cmd1 'パラメータ:'
strconcat cmd1 param2
sendln cmd1

コメントアウト

;コメントアウト

変数

パラメータ

バージョン 記述 備考
Tera Term 4.91まで param2 param9まで
Tera Term 4.92から params[2] params 数の上限なし

params[0] にはコマンドライン文字列全体が格納され、params[1] にはマクロファイル名が格納される。
params[2] 以降はマクロファイルに渡されるパラメータが順番に格納される。

参考文献

文字列連結

コード str
str = 'a' a
strconcat str 'b' ab
strconcat str 'c' abc

呼び出し方

パラメータなし

  • ttlファイルの実行アプリケーションを ttpmacro.exe にする。
  • ttlファイルのあるディレクトリに移動しttlファイルを実行する。

パラメータあり

ttpmacro.exe のディレクトリに移動し ttpmacro.exe + ttlファイル名 + パラメータ で実行する

ttpmacro.exe C:\Users\user\Desktop\FailName.ttl param1 param2

参考文献

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?