利用SecureCRT实现Linux编译

新建批处理--buildLinux.cmd
---------------------------------------------------------------------
del E:\dailybuilder\ftpTemp\linux
SecureCRT.EXE 
/ " 192.168.0.2 "   / script  " E:\dailybuilder\WebSite\Tools\Linux.vbs "
copy 
/ Y E:\dailybuilder\ftpTemp\linux E:\dailybuilder\WebSite\buildFolder\
REM Taskkill 
/ IM SecureCRT.EXE  / T
---------------------------------------------------------------------

新建VBScript文件--Linux.vbs
---------------------------------------------------------------------
#$language 
=   " VBScript "
#$
interface   =   " 1.0 "

Sub main
  
'  turn on synchronous mode so we don ' t miss any data
  crt.Screen.Synchronous 
=  True
  If (Not crt.Screen.WaitForString(
" username " 8 )) Then
    crt.Screen.Send vbCr
    crt.Screen.WaitForString 
" username "
  End If
  
  crt.Screen.Send 
" cd /home/username/Coding "   &  VbCr
     crt.Screen.WaitForString 
" Coding "
  crt.Screen.Send 
" mk -c project.plf "   &  VbCr
     crt.Screen.WaitForString 
" Coding "
     crt.Screen.Send 
" cd /home/username/Coding/product/linuxd "   &  VbCr
     crt.Screen.WaitForString 
" linuxd "
     crt.Screen.Send 
" ftp 192.168.0.1 "   &  VbCr
     crt.Screen.WaitForString 
" Name  "
     crt.Screen.Send 
" ftpUser "   &  VbCr     
     crt.Screen.WaitForString 
" Password: "
     crt.Screen.Send 
" ftpPassword "   &  VbCr
     
' crt.Screen.WaitForString "ftp>"
      ' crt.Screen.Send "delete jx_linux_t" & VbCr
     crt.Screen.WaitForString  " ftp> "
     crt.Screen.Send 
" put linux "   &  VbCr
     crt.Screen.WaitForString 
" ftp> "
     crt.Screen.Send 
" quit "   &  VbCr
     crt.Screen.WaitForString 
" linuxd "
     crt.Screen.Send 
" exit "   &  VbCr
    crt.Sleep 
2000
  
'  turn off synchronous mode to restore normal input processing
  crt.Screen.Synchronous  =  False
  crt.Sleep 
2000
  crt.Quit
End Sub
---------------------------------------------------------------------

附录(SecureCRT帮助):
Application Object Properties and Methods

Properties
 Methods
 
    ActivePrinter 
     GetTabCount
 
    Dialog
     GetTab
 
    Screen
     Sleep
 
    Session
     Quit
 
    Version
  
 
    Window
  
 

 

Properties

 

ActivePrinter

Description

Returns or sets the name of the active printer.

Syntax

crt.ActivePrinter [ = printerName ] 

Remarks

Read/Write string property.

Example:

If crt.ActivePrinter "\\SERVER\InkJet2" Then

crt.ActivePrinter = "\\SERVER\InkJet2"

MsgBox "Updated Printer"

End If

 

Dialog

Description

Returns a reference to SecureCRT's Dialog object.

Syntax

Set object = crt.Dialog

Remarks

See the Dialog object documentation for a description of its properties and methods.

 

Screen

Description

Returns a reference to SecureCRT's Screen object.

Syntax

Set object = crt.Screen

Remarks

Object variables assigned from the screen property require the "Set" syntax. See the Screen object documentation for a description of its properties and methods.

 

Session

Description

Returns a reference to SecureCRT's Session object.

Syntax

Set object = crt.Session

Remarks

See the Session object documentation for a description of its properties and methods.

 

Version

Description

Returns a string containing SecureCRT's version.

Syntax

crt.Version

Remarks

Read-only string property

 

Example:

MsgBox "The version of SecureCRT is: " & crt.Version

 

Window

Description

Returns a reference to SecureCRT's Window object.

Syntax

Set object = crt.Window

Remarks

See the Window object documentation for a description of its properties and methods.

 

 

Methods

GetTabCount

Description

Returns the number of tabs.

Syntax

object = crt.GetTabCount

Remarks

None.

 

GetTab

Description

Returns the tab object of the specified index.

Syntax

Set object = crt.GetTab arg

Remarks

This does not bring the tab to the foreground.

 

Sleep

Description

Specifies the time (in milliseconds) to pause the script's execution

Syntax

crt.Sleep millisec

Remarks

The amount of time that it takes to execute the Sleep() method itself is a factor in how long the script pauses. Therefore, the accuracy of invoking Sleep with small values of 1 or 10 milliseconds will be affected by this overhead.

 

Example:

' Send a CR and pause for one second

crt.Screen.Send vbCr

crt.Sleep 1000

 

Quit

Description

Causes SecureCRT to exit.

Syntax

crt.Quit

Remarks

A script that invokes Quit will be terminated immediately and cause SecureCRT to exit.

转载于:https://www.cnblogs.com/linn/archive/2007/03/14/674241.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值