grep
来自「EPIC IRC客户端。来源于IRCII客户端但做了很多性能和功能的优化。」· 代码 · 共 72 行
TXT
72 行
## grep 1.0 -- adds [e]grep support to the client, neat# Author -- wd@anduril.org White_Dragon Chip Norkus# Any deviation from the original is Jeremy Nelson's fault.## Contributed to the EPIC project by Phoengold, on Fri, 14 Apr 2000.## Usage: /grep [-w #] <text># /egrep [-w #] <text># Performs a text search on the lastlog of the current/specified window## At the most basic level, /grep searches the lastlog of your current window# for the specified text. with the -w option you can specify the window# whose lastlog you want to use. A regular expression of any sort can be# used, as well.#alias grep { ^local win,exp,re,i,x,l,s.,l. if (![$0]) { echo Usage: /grep [-w #] <text> return } @ win = 1 if ([$0] == [-w]) { if (![$2]) { return } @ win = [$1] @ exp = [$2-] }{ @ exp = [$*] } if (!winlevel($win)) { assign -win } @ re = regcomp($exp) ### grep here, and save the lines @ i = getset(LASTLOG) @ x = 0 while (i) { @ l = line($i $win) if (!regexec($re $l)) { @ s[$x] = l @ l[$x] = i @ x++ } @ i-- } @ regfree($re) echo ------------------ Results of grep: ---------------------- @ i = 0 while (i < x) { xecho -nolog $[4]l[$i]: $s[$i] @ i++ } echo ------------------------ End -----------------------------}#WhiteDragon'Y2K
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?