亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
12下一頁(yè)
最近訪問(wèn)板塊 發(fā)新帖
查看: 5517 | 回復(fù): 12
打印 上一主題 下一主題

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?  關(guān)閉 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2005-10-02 17:17 |只看該作者 |倒序?yàn)g覽
最近看sed1line,出現(xiàn)了2個(gè)詞,老是在我眼前晃。。。

hold space  

pattern space

上面解釋為:

保留空間(內(nèi)存緩沖區(qū))

模式空間

我發(fā)現(xiàn)原文翻譯和解釋的有寫(xiě)混亂,一開(kāi)始還說(shuō)保留空間,最后就不提了,把模式空間說(shuō)成內(nèi)存緩沖區(qū)了,總之把偶給搞糊涂了。


希望那位高手,能給偶解釋下什么是模式空間,嘿嘿,最好通俗點(diǎn),也最好別說(shuō)成內(nèi)存緩沖區(qū)啊,那樣偶就更糊涂了。。。     

謝謝了!

    

論壇徽章:
1
榮譽(yù)會(huì)員
日期:2011-11-23 16:44:17
2 [報(bào)告]
發(fā)表于 2005-10-02 20:24 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

sed在處理文件的時(shí)候,每一行都需要存放在一個(gè)叫“模式空間”的臨時(shí)緩存區(qū)!每處理完一行,便清理一次(pattern space),并把下一行再次放入!
而保留空間(hole space),是當(dāng)sed用到h命令的時(shí)候,把匹配的模式放在一個(gè)叫做"hold buffer"的保留緩沖里,但需要使用G(sed的取得命令)的時(shí)候,sed 從這個(gè)保留空間(hold space)中取得(G),....
PS:這是我的理解!我對(duì)see了解不多!還是讓sed高手釋疑吧

論壇徽章:
0
3 [報(bào)告]
發(fā)表于 2005-10-03 00:17 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

謝謝烈火兄!

叫“模式空間”的臨時(shí)緩存區(qū)--------和-------------叫做"hold buffer"的保留緩沖,,,,,,,,,是不是都在內(nèi)存緩沖區(qū)里呢?


不好意思,可能我的理解能力差,所以,還請(qǐng)高人繼續(xù)點(diǎn)醒我啦。。。

期待!

論壇徽章:
1
榮譽(yù)會(huì)員
日期:2011-11-23 16:44:17
4 [報(bào)告]
發(fā)表于 2005-10-03 00:33 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

顧名思義,Sed  is a stream editor,那么,sed處理數(shù)據(jù)的地方當(dāng)然是在內(nèi)存里
PS:跟樓主一齊等待  

論壇徽章:
0
5 [報(bào)告]
發(fā)表于 2005-10-04 21:47 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

頂下。

論壇徽章:
0
6 [報(bào)告]
發(fā)表于 2005-10-05 22:09 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

following explaination could be small but concise , can treat it as a guideline when you study all the sed commands.

Where SED buffers data
SED maintains two data buffers: the active pattern space, and the auxiliary hold space. In "normal" operation, SED reads in one line from the input stream and places it in the pattern space. This pattern space is where text manipulations occur. The hold space is initially empty, but there are commands for moving data between the pattern and hold spaces.

right, a small practice here for SED command "x" :
'x'  - Exchange the contents of the hold and pattern spaces.

  1. say a file contains following 3 lines ,
  2. #cat file
  3. line1
  4. line2
  5. line3
  6. #
  7. by applying 'x' command, the output is as following :
  8. #sed 'x' file

  9. line1
  10. line2
  11. #
  12. explain :

  13.             <-- first line is empty , because hold space and pattern space exchange the contents , do remember initially the hold space is empty , now hold space contains line1 after first line data manipulation .
  14. line1     <- second output is line1, now hold space contains line2 , and so on a so forth . ^_^
  15. line2
復(fù)制代碼

論壇徽章:
0
7 [報(bào)告]
發(fā)表于 2005-10-06 22:57 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

感謝指點(diǎn)!

理解中。。。

論壇徽章:
0
8 [報(bào)告]
發(fā)表于 2005-10-07 13:54 |只看該作者

向高手請(qǐng)教下:pattern space(模式空間) 是什么意思?

嘗試過(guò)確實(shí)如此,但看了解釋還是不能完全理解,
能說(shuō)得更詳細(xì)點(diǎn)嗎?

論壇徽章:
0
9 [報(bào)告]
發(fā)表于 2005-11-23 13:48 |只看該作者
剛從一個(gè)帖子里看到的2位高手的:

dbcat:
man sed

h H    Copy/append pattern space to hold space.
                                                                                                                              
g G    Copy/append hold space to pattern space.


waker:
pattern space相當(dāng)于車(chē)間sed把流內(nèi)容在這里處理
hold space相當(dāng)于倉(cāng)庫(kù),加工的半成品在這里臨時(shí)儲(chǔ)存

論壇徽章:
0
10 [報(bào)告]
發(fā)表于 2005-11-23 13:53 |只看該作者
原帖由 yuyuyou 于 2005-11-23 13:48 發(fā)表
剛從一個(gè)帖子里看到的2位高手的:

dbcat:


waker:


http://930699.k43.opensrs.cn/bbs/index.php?showtopic=744
蠻可愛(ài)的小站啊
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專(zhuān)區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP