随笔分类 - tcl
摘要:自动登录主机(ssh) 建脚本item2login.sh,包含如下内容 #!/usr/bin/expect set timeout 30 spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2] expect { "*(yes/n
阅读全文
摘要:Tcl是一个比较简洁的脚本语言,官方地址 http://www.tcl.tk. tcl脚本加载C实现的动态库非常方便。 1. 为Tcl编写一个用C实现的扩展函数。 #include <stdio.h> #include <stdlib.h> #include <string.h> #include
阅读全文
摘要:Tuxedo是Oracle的一个商业中间件,一般用于通信。 如下是一个简单的调用tuxedo的so动态库实现,编译后,tcl脚本可以加载并调用这个so库实现对tuxedo的调用。 1. 代码例子,保存文件为tuxedotcl.cc #include <stdio.h> #include <tcl.h
阅读全文
摘要:package require "http" proc errLog args { puts $args } proc SendHttp args { global token set toUrl [lindex $args 0] if {[catch {set token [::http::get
阅读全文