⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zgrepapi.cmd

📁 完整的解压zip文件的源码。包含密码功能
💻 CMD
字号:
/*---------------------------------------------------------------------------   zapigrep.cmd  (ye olde REXX procedure for OS/2)   Script to search members of a zipfile for a string and print the names of   any such members (and, optionally, the matching text).   This is the zipgrep.cmd program completely rewritten to take advantage   of the REXX API.  Among the improvements are:        egrep no longer needed.  All work done by API and this script.	Added option switches.   Be aware, however, that this script does not support regular expressions   as zipgrep does.  ---------------------------------------------------------------------------*/PARSE ARG argsnocase = 0word = 0text = 0DO WHILE Left(args,1) == '-' | Left(args,1) == '/'   PARSE VAR args option args   option = Translate(SubStr(option,2))   DO WHILE option \= ''      oneopt = Left(option,1)      option = SubStr(option,2)      SELECT       WHEN oneopt == 'W' THEN	  word = 1       WHEN oneopt == 'I' THEN	  nocase = 1       WHEN oneopt == 'T' THEN	  text = 1       OTHERWISE NOP      END   ENDENDPARSE VAR args string zipfile membersIF (string == '') THEN DO   SAY 'usage:  zipgrep [-i][-t][-w] search_string zipfile [members...]'   SAY '   Displays the names of zipfile members containing a given string.'   SAY '   By default it displays filenames only of members containing an'   SAY '   exact match of the string.  Options are:'"0a"x   SAY '	-i  Ignore case'   SAY '	-t  Display matching lines'   SAY '	-w  Match words only'   EXIT 1ENDstring = Strip(string,'b','"')IF nocase THEN string = Translate(string)CALL RxFuncAdd 'UZLoadFuncs', 'UNZIP32', 'UZLoadFuncs'CALL UZLoadFuncsCALL UZUnZipToStem zipfile, 'file.', membersDO i = 1 TO file.0   ptr = file.i   file = file.ptr   IF nocase THEN file = Translate(file)   IF word THEN DO      wp = WordPos(string,file)      IF wp>0 THEN	 scan = WordIndex(file,wp)      ELSE         scan = 0   END   ELSE      scan = Pos(string,file)   IF scan \= 0 THEN DO      SAY file.i':'      IF text THEN DO	 DO WHILE scan > 0	    from = LastPos('0a'x,file,scan)+1	    to = Pos('0a'x,file,scan)	    IF to = 0 THEN to = Length(file.ptr)	    oneline = Strip(SubStr(file.ptr,from,to-from),'T','0a'x)	    SAY Strip(oneline,'T','0d'x)	    IF word THEN DO	       wp = WordPos(string,file,wp+1)	       IF wp>0 THEN		  scan = WordIndex(file,wp)	       ELSE	       	  scan = 0	    END	    ELSE	       scan = Pos(string,file,scan+1)	 END      END   ENDENDEXIT 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -