藍森林首頁 | 返回主頁 | 本站地圖 | 站內搜索 | 聯繫信箱 |
 您目前的位置:首頁 > 自由軟件 > 技術交流 > 系統管理


    

藍森林 http://www.lslnet.com 2006年8月18日 15:18


向大家請教一個 bounce shell 行編譯器 ed 的問題

1。text_file的內容:

This is line 1
This is line 2
This is line 3
This is line 4

2。文件here2的內容:
#!/bin/sh
ed text_file <<!FunkyStuff!
3
d
.,\$s/is/was/
w
q
!FunkyStuff!
exit 0

在linux 終端中敲入以下命令:
/bin/sh here2

結果發現腳本不能正常執行:
輸出是:
66
This is line 3
?

不知道是什麼原因,上面的例子是我從書上抄寫下來的,經過研究,發現隨書帶的例子源代碼中也是這樣寫的,結果一樣!向大家請教,這到該怎麼解決呢?



Copyright © 1999-2000 LSLNET.COM. All rights reserved. 藍森林網站 版權所有。 E-mail : webmaster@lslnet.com