目前分類:[Script] (9)

瀏覽方式: 標題列表 簡短摘要

function myFunction()
{
var x=document.getElementById("fname");
document.getElementById("show").innerHTML="\n你好\n你的帳號"+x.value+"開好了";
}

slinbody 發表在 痞客邦 留言(0) 人氣()

#vi ssh-expect
===================
#!/usr/bin/expect

set timeout 60

spawn ssh -p 22 [lindex $argv 1]@[lindex $argv 0]

slinbody 發表在 痞客邦 留言(0) 人氣()

#vi test.sh
-------------------------------

set device 10.0.0.1
set passwd [你的密碼]

slinbody 發表在 痞客邦 留言(0) 人氣()

#vi test.sh
-------------------------------------------
#!/usr/bin/expect -f
set host [lindex $argv 0] 
set password [密碼填此處]

slinbody 發表在 痞客邦 留言(0) 人氣()

參考

expect要紀錄執行結果或輸出
可以用log_file這個指令

#!/usr/bin/expect -f

slinbody 發表在 痞客邦 留言(0) 人氣()

#vi myscript

#此script可一次帶多個參數

#依序執行
#!/usr/bin/expect -f

slinbody 發表在 痞客邦 留言(0) 人氣()

 


#!/bin/sh
i=2
while [ $i -lt 5 ]     //注意空格

slinbody 發表在 痞客邦 留言(0) 人氣()

 


#!/usr/bin/expect
log_user 0             //0不顯示輸出
spawn telnet 10.0.8.250

slinbody 發表在 痞客邦 留言(0) 人氣()

 

#統計squid Hit-rate

 


more /tmp/test

slinbody 發表在 痞客邦 留言(0) 人氣()