利用SecureCRT實現Linux編譯

來源:互聯網
上載者:User
建立批處理--buildLinux.cmd---------------------------------------------------------------------
del E:\dailybuilder\ftpTemp\linux
SecureCRT.EXE /s "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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.