linux下安裝expect

來源:互聯網
上載者:User

我實驗的環境是SuSe Linux 10.1

 

expect的首頁:http://expect.nist.gov/

最新穩定版5.43.0的:http://expect.nist.gov/expect.tar.gz

expect依賴於tcl/tk,因此在安裝expect之前先安裝tcl/tk。

tcl/tk8.4.16的下載面頁:
http://www.tcl.tk/software/tcltk/downloadnow84.html

軟體包的:
http://prdownloads.sourceforge.net/tcl/tcl8.4.16-src.tar.gz

http://prdownloads.sourceforge.net/tcl/tk8.4.16-src.tar.gz

 

檢查系統,看tcl是否已經安裝。

[root@rhel ~]# rpm -qa|grep tcl

 

已經安裝的情況:

 

因為expect需要重新編譯後安裝,那麼就需要tcl的開發包。

rpm -ivh --force tcl-devel-8.4.13-3.fc6.i386.rpm

然後將expect-5.43包解開,開始讀INSTALL文檔,系統管理員告訴我,不用讀,直接運行 ./configure --help開參數。確實好使,又土了一次 。

  

1.首先確定tcl開發包安裝的位置

rpm -qpl tcl-devel-8.4.13-3.fc6.i386.rpm|more

2.然後根據參數,運行./configure

./configure --with-tcl=/usr/lib --with-tclinclude=/usr/include/tcl-private/generic

3.執行

make

4.執行

make install

    

完成第四步後,expect順利安裝成功。 -

 

沒有安裝的情況:

第一步,安裝tcl

[root@supersun.biz download]#cd tcl8.4.16/unix/

./configure

make

make install

安裝之後不要刪除源碼包,在安裝expect時需要tcl的標頭檔。

安裝完畢以後,進入tcl原始碼的根目錄,把子目錄unix下面的tclUnixPort.h copy到子目錄generic中

第二步,安裝tk

[root@supersun.biz download]#cd tk8.4.16/unix/

./configure

make

make install

第三步,安裝expect

在不提供參數的情況下執行configure報錯:

checking for Tcl private headers... checking for tclInt.h... no

configure: error: Can't find Tcl private headers

再次運行configure指令碼,並指定tcl的標頭檔所在目錄:

[root@supersun.biz expect-5.43]#./configure --with-tclinclude=../tcl8.4.16/generic

指令碼運行正常,進行執行make進行編譯

make

如果make,或是configure有錯誤的話,根據提示,再增加配置參數

編譯過程中未出現錯誤,執行安裝:

make install

 

 

配置參數的意思是:

·

--with-tcl=/usr/tcl/lib
:(我的環境中是/usr/local/lib)
確保配置指令碼找到臨時工具目錄中的Tcl
,我們不希望它使用主系統中可能存在的tcl.

·

--with-x=no
:
告訴配置指令碼,不要尋找 Tk (Tcl
的 GUI
組件)
或 X
視窗系統庫,這兩個都有可能存在於主系統中。

·

-with-tclinclude
:協助指令碼找到所需要的tcl
標頭檔。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.