home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / dhg_106a.zip / DHG_LRG.HLP (.txt) < prev    next >
OS/2 Help File  |  1999-02-26  |  16KB  |  421 lines

  1.  
  2. ΓòÉΓòÉΓòÉ 1. DH-Grep-PM Introduction ΓòÉΓòÉΓòÉ
  3.  
  4. General information about DH-Grep-PM 
  5.  
  6. Grep stands for "Get Regular Expression and Print" and is a text searching tool 
  7. that was first developed for unix systems and has been ported to most operating 
  8. systems. 
  9.  
  10. This PM version of grep is designed as a user friendly application.  It is 
  11. designed for a multitasking environment and the search takes place on a 
  12. separate thread to minimize the time that the wait icon is displayed. It will 
  13. also run in a low priority idle mode to further reduce the impact the search 
  14. has on the other active programs. 
  15.  
  16. The often cryptic command line options have been replaced with easy to use 
  17. selections on the OS/2 menu bar. The output of the search is sent to a PM 
  18. window and the user has easy access to all of the information that was found by 
  19. the program. 
  20.  
  21. To reduce the overhead, the results are buffered until the search is completed 
  22. and then written to the results window.  To indicate that the search is still 
  23. active, the small icon at the left of the title bar will change color as an 
  24. activity indicator. The color change depends on the search results, so it does 
  25. not change at a fixed rate. 
  26.  
  27. This program will try to search binary files as well as text files, but it 
  28. still tries to read "lines" from the binary file.  The program reads from the 
  29. file until a new-line is found or 4096 characters have been read. 
  30.  
  31. If a new-line is not found and the program reads in 4096 characters there is a 
  32. very good chance that a word will be split.  If that word is what you are 
  33. searching for, the search will fail. 
  34.  
  35. Binary files can and often do contain null characters. The C/C++ string 
  36. handling functions all use a null character as a string terminator and the 
  37. "line" will be truncated at the first null character by those functions.  This 
  38. means that the program may miss finding the search pattern in a binary file. 
  39.  
  40. I have added an option to replace null characters with spaces, but using that 
  41. option will increase the search time. This option may be useful when doing a 
  42. search in word processor files.  See BINARY Flag 
  43.  
  44. This version of grep does not support the full set of "regular expressions" 
  45. that most of the command line versions of grep support.  It does support two 
  46. wild-card characters.  The '*' character represents multiple characters and the 
  47. character '?' represents one character. Thus a search pattern of "h*e"  would 
  48. match both "house" and "horse". A search pattern of "ho?se" would also match 
  49. both words. 
  50.  
  51.  
  52. ΓòÉΓòÉΓòÉ 1.1. Binary Files ΓòÉΓòÉΓòÉ
  53.  
  54. This program will try to search binary files as well as text files, but it 
  55. still tries to read "lines" from the binary file.  The program reads from the 
  56. file until a new-line is found or 4096 characters have been read. 
  57.  
  58. If a new-line is not found and the program reads in 4096 characters there is a 
  59. very good chance that a word will be split.  If that word is what you are 
  60. searching for, the search will fail. 
  61.  
  62. Binary files can and often do contain null characters. The C/C++ string 
  63. handling functions all use a null character as a string terminator and the 
  64. "line" will be truncated at the first null character by those functions.  This 
  65. means that the program may miss finding the search pattern in a binary file. 
  66.  
  67. I have added an option to replace null characters with spaces, but using that 
  68. option will increase the search time. This option may be useful when doing a 
  69. search in word processor files.  See BINARY Flag 
  70.  
  71.  
  72. ΓòÉΓòÉΓòÉ 1.2. Regular Expressions ΓòÉΓòÉΓòÉ
  73.  
  74. This version of grep does not support the full set of "regular expressions" 
  75. that most of the command line versions of grep support.  It does support two 
  76. wild-card characters.  The '*' character represents multiple characters and the 
  77. character '?' represents one character. Thus a search pattern of "h*e"  would 
  78. match both "house" and "horse". A search pattern of "ho?se" would also match 
  79. both words. 
  80.  
  81.  
  82. ΓòÉΓòÉΓòÉ 1.3. File ΓòÉΓòÉΓòÉ
  83.  
  84. This menu selection opens a pull-down menu that contains selections to save, 
  85. reload, or print the results of the search. The external editor is also on this 
  86. menu. 
  87.  
  88.  
  89. ΓòÉΓòÉΓòÉ 1.3.1. Save As ΓòÉΓòÉΓòÉ
  90.  
  91. The Save As selection opens a file dialog box that allows the user to enter a 
  92. file name to use for saving the search results. If the user enters the name of 
  93. an existing file, the utility will warn the user and ask for verification 
  94. before writing the file. 
  95.  
  96.  
  97. ΓòÉΓòÉΓòÉ 1.3.2. Load File ΓòÉΓòÉΓòÉ
  98.  
  99. The Load File selection opens a file dialog box that allows the user to select 
  100. a file to load into the results window. 
  101.  
  102.  
  103. ΓòÉΓòÉΓòÉ 1.3.3. Print On Default Printer ΓòÉΓòÉΓòÉ
  104.  
  105. The Print On Default Printer selection sends the contents of the results window 
  106. to the default system printer. This is a raw dump of the results window to the 
  107. default system printer and no attempt to format the text. 
  108.  
  109.  
  110. ΓòÉΓòÉΓòÉ 1.3.4. Load Marked File In External Editor ΓòÉΓòÉΓòÉ
  111.  
  112. To use the external editor option, you must create a CMD file named 
  113. EDIT_CMD.CMD that calls the editor you wish to use.  A minimal CMD file to use 
  114. the OS/2 system editor E would contain the following line. 
  115.  
  116. e %1 
  117.  
  118. The CMD file should be located in the working directory. 
  119.  
  120. To use the external editor, the cursor must be on a line that contains the name 
  121. of a file that was found during the search. After the cursor is on the line, 
  122. either an ALT+W key press or a Right Mouse Button double click will launch the 
  123. CMD file. The cusror can be moved to a specific line by a Left Mouse Button 
  124. click. 
  125.  
  126. Note:  The RMB double click will not move the cursor to the desired line. 
  127.  
  128.  
  129. ΓòÉΓòÉΓòÉ 1.4. Display ΓòÉΓòÉΓòÉ
  130.  
  131. This menu selection opens a pull-down menu that contains selections that affect 
  132. how the results are displayed after the search has been completed. 
  133.  
  134.  
  135. ΓòÉΓòÉΓòÉ 1.4.1. Font ΓòÉΓòÉΓòÉ
  136.  
  137. The Font selection opens a standard OS/2 Font dialog box that lets the user 
  138. select a new font or change the font size for the displayed results.  This will 
  139. allow the selection of any of the installed fonts. This option only changes the 
  140. font in the main window. 
  141.  
  142. To change the font for the menubar or the information area below the main 
  143. window, use the OS/2 font palette and drag and drop a new font on either area. 
  144. The font selections are only saved when 'Save Settings' is selected. 
  145.  
  146. Note:  For the main window, font drag and drop does not always work correctly. 
  147. The displayed font will be correct, but the wrong font size may be saved. 
  148.  
  149.  
  150. ΓòÉΓòÉΓòÉ 1.4.2. Word Wrap ΓòÉΓòÉΓòÉ
  151.  
  152. The Word Wrap selection enables or disables the word wrap feature of the 
  153. results window. 
  154.  
  155. Note:  The Word Wrap is a software word wrap and it does not insert hard 
  156.        carriage return - line feed  pairs. 
  157.  
  158.  
  159. ΓòÉΓòÉΓòÉ 1.4.3. Do not clear past results ΓòÉΓòÉΓòÉ
  160.  
  161. This selection disables the clearing of the results window when a new search is 
  162. started.  It is useful if the user wishes to save the search results from 
  163. several related searches. 
  164.  
  165.  
  166. ΓòÉΓòÉΓòÉ 1.4.4. Reset to default colors ΓòÉΓòÉΓòÉ
  167.  
  168. The 'Reset to default colors' option restores the system default background and 
  169. foreground colors.  To change the colors on the menubar, main window, or the 
  170. information area use the OS/2 color palette and drag and drop a color 
  171. selection.  When 'Save Settings is selected , the color selections are made the 
  172. default colors. 
  173.  
  174. Note:  The background and foreground colors of the results window may be set 
  175.        via drag and drop from the OS/2 Color Palette. The other colors may also 
  176.        be changed, but only the background and foreground colors of the results 
  177.        window are saved. 
  178.  
  179.  
  180. ΓòÉΓòÉΓòÉ 1.4.5. Get file names in display ΓòÉΓòÉΓòÉ
  181.  
  182. This selection will cause the program to scan all of the results text and 
  183. extract the file names and insert them at the top of the results window.  This 
  184. provides the user with a list of file names that can be imported into another 
  185. document or used by another program. 
  186.  
  187.  
  188. ΓòÉΓòÉΓòÉ 1.4.6. Edit ΓòÉΓòÉΓòÉ
  189.  
  190. The results window is an MLE (MultiLine Editor) window and it has the basic 
  191. OS/2 editor functions. This selection brings up a submenu with the available 
  192. edit functions. 
  193.  
  194.  
  195. ΓòÉΓòÉΓòÉ 1.4.7. Open Enter Search Parameters Immediately ΓòÉΓòÉΓòÉ
  196.  
  197. This selection will cause the program to open the 'Enter Search Parameters' 
  198. window immediately after the program is loaded.  This is one of the settings 
  199. that are saved when the user selects the "Save option settings in program INI 
  200. file" menu item. 
  201.  
  202.  
  203. ΓòÉΓòÉΓòÉ 1.5. Configure Search ΓòÉΓòÉΓòÉ
  204.  
  205. This menu selection opens a pull-down menu that contains selections to 
  206. configure the search and the search parameters. 
  207.  
  208.  
  209. ΓòÉΓòÉΓòÉ 1.5.1. Case Sensitive Search ΓòÉΓòÉΓòÉ
  210.  
  211. When this option is checked, the search is case sensitive.  The default is to 
  212. ignore case in the search pattern. 
  213.  
  214.  
  215. ΓòÉΓòÉΓòÉ 1.5.2. Set absolute flag ΓòÉΓòÉΓòÉ
  216.  
  217. When this option is checked, the search pattern is absolute. The two wild-card 
  218. characters are treated as characters and not wild-cards. 
  219.  
  220. Regular Expressions 
  221.  
  222.  
  223. ΓòÉΓòÉΓòÉ 1.5.3. Search Subdirectories ΓòÉΓòÉΓòÉ
  224.  
  225. When this option is checked, the program starts the search in the specified 
  226. directory and searches in all subdirectories (recursively) for files that match 
  227. the file mask. The default is to not search in subdirectories. 
  228.  
  229.  
  230. ΓòÉΓòÉΓòÉ 1.5.4. Set NOT Flag ΓòÉΓòÉΓòÉ
  231.  
  232. When this option is checked, the search results will contain all the lines that 
  233. do not contain the search pattern. This means that all of the lines in a file 
  234. that does not contain the search pattern would be displayed in the results 
  235. window. 
  236.  
  237.  
  238. ΓòÉΓòÉΓòÉ 1.5.5. Set NAME Flag ΓòÉΓòÉΓòÉ
  239.  
  240. When this option is checked, only the names of files that contain the search 
  241. pattern are displayed in the results window. 
  242.  
  243.  
  244. ΓòÉΓòÉΓòÉ 1.5.6. Show Line Numbers ΓòÉΓòÉΓòÉ
  245.  
  246. When this option is checked, line numbers are included in the results window. 
  247. This makes it easier to find the search pattern when the file is loaded into an 
  248. editor. 
  249.  
  250.  
  251. ΓòÉΓòÉΓòÉ 1.5.7. Use idle time priority for search thread ΓòÉΓòÉΓòÉ
  252.  
  253. When this option is checked, the priority of the thread that does the searching 
  254. is reduced to the lowest priority. This priority only gets processing time when 
  255. there is no other work to do.  This option allows the user to do a search in 
  256. the background without a significant impact on the other active tasks. 
  257.  
  258.  
  259. ΓòÉΓòÉΓòÉ 1.5.8. Files newer than Age Mask ΓòÉΓòÉΓòÉ
  260.  
  261. When this option is checked, only files with dates newer or equal to the Age 
  262. Mask value will be evaluated. 
  263.  
  264. File Age 
  265.  
  266.  
  267. ΓòÉΓòÉΓòÉ 1.5.9. Files older than Age Mask ΓòÉΓòÉΓòÉ
  268.  
  269. When this option is checked, only files with dates older than the Age Mask 
  270. value will be evaluated.  Do not use this option with a Age Mask of 0, it will 
  271. just increase the search time. 
  272.  
  273. File Age 
  274.  
  275.  
  276. ΓòÉΓòÉΓòÉ 1.5.10. Skip known binary files ΓòÉΓòÉΓòÉ
  277.  
  278. When this option is checked, the utility will skip the following known binary 
  279. file types by looking at the file extent. 
  280.  
  281.  .exe, .dll, .lib, .ico, .gif, .jpg 
  282.  
  283.  .zip, .inf, .hlp, .obj, .com, .res 
  284.  
  285. This utility will try to search for the search pattern in any file. If you know 
  286. the extent of the files you wish to search, you should use that extent in the 
  287. file mask to reduce the number of files that are searched. 
  288.  
  289. If you are not sure of the file extent and you know that you do not need to 
  290. search any binary files, then this option should be selected. 
  291.  
  292. Binary Files 
  293.  
  294.  
  295. ΓòÉΓòÉΓòÉ 1.5.11. Search for files only, no pattern search ΓòÉΓòÉΓòÉ
  296.  
  297. When this option is checked, the utility will just search for files that match 
  298. the file mask and the other search parameters. The contents of the file will 
  299. not be checked. 
  300.  
  301.  
  302. ΓòÉΓòÉΓòÉ 1.5.12. BINARY Flag ΓòÉΓòÉΓòÉ
  303.  
  304. When this option is checked, the program will replace any null characters that 
  305. are read with spaces. The file being searched is not modified, only the data 
  306. that is read from the file. 
  307.  
  308. This option is intended for searching word processor files that have embedded 
  309. null characters - such as DeScribe.  Using this option will increase the search 
  310. time, so it should only be used when needed. 
  311.  
  312. Searches in binary files often fail. Many compilers will compress or condense 
  313. text strings and a search will not find the altered text.  Many word processors 
  314. also modify text so that addional information about formatting can be stored 
  315. with the text. 
  316.  
  317. Binary Files 
  318.  
  319.  
  320. ΓòÉΓòÉΓòÉ 1.5.13. Enter Search Parameters ΓòÉΓòÉΓòÉ
  321.  
  322. This selection opens a dialog box that has 4 entry fields. 
  323.  
  324. Search Path 
  325.  
  326. File Mask 
  327.  
  328. Search Pattern 
  329.  
  330. File Age 
  331.  
  332. All the fields except 'File Age' must be filled in or the search cannot be 
  333. started. 
  334.  
  335. The 'Search Path' is checked to see if a valid path has been entered when the 
  336. user clicks on the 'Ok' or 'Start' buttons. 
  337.  
  338.  
  339. ΓòÉΓòÉΓòÉ 1.5.13.1. Search Path ΓòÉΓòÉΓòÉ
  340.  
  341. The search path consists of the Drive letter and the path without the file 
  342. name. 
  343.  
  344. For Example:  C:\OS2\APPS\ 
  345.  
  346. The ending '\' is not required 
  347.  
  348. The searching of subdirectories is controled by another option setting under 
  349. 'Configure Search' on the menubar. 
  350.  
  351. Search Subdirectories 
  352.  
  353.  
  354. ΓòÉΓòÉΓòÉ 1.5.13.2. Browse ΓòÉΓòÉΓòÉ
  355.  
  356. The Browse button opens a dialog box that will allow the user to select a 
  357. search path.  This dialog box is similar to the normal File Dialog box , except 
  358. that there is no way to select a file name.  The file names are still displayed 
  359. to aid the user in finding the correct directory. 
  360.  
  361. File Mask 
  362.  
  363.  
  364. ΓòÉΓòÉΓòÉ 1.5.13.3. File Mask ΓòÉΓòÉΓòÉ
  365.  
  366. The file mask represents the file or files to be searched without any path 
  367. information. Wild cards are allowed. 
  368.  
  369. For Example: 
  370. *.txt 
  371. *.msg 
  372. a?bc.txt 
  373.  
  374. Note:  In OS/2  "*" as a search pattern (not "*.*") means search ALL files. 
  375.  
  376.  
  377. ΓòÉΓòÉΓòÉ 1.5.13.4. Search Pattern ΓòÉΓòÉΓòÉ
  378.  
  379. The search pattern can contain up to 512 characters. This version of grep does 
  380. not support the full set of "regular expressions" that most of the command line 
  381. versions of grep support.  It does support two wild-card characters.  The '*' 
  382. character represents multiple characters and the character '?' represents one 
  383. character. Thus a search pattern of "h*e"  would match both "house" and 
  384. "horse". A search pattern of "ho?se" would also match both words. 
  385.  
  386. The use of the wild-card characters depends on the setting of the Set absolute 
  387. flag 
  388.  
  389.  
  390. ΓòÉΓòÉΓòÉ 1.5.13.5. File Age ΓòÉΓòÉΓòÉ
  391.  
  392. The File Age entry is used when one of the age limit options is used. The 
  393. number can be in the range 0 to 999 days.  The lower range of zero is used to 
  394. indicate today when the 'newer than' search option is checked. 
  395.  
  396. Files newer than Age Mask 
  397.  
  398. Files older than Age Mask 
  399.  
  400.  
  401. ΓòÉΓòÉΓòÉ 1.5.14. Save option settings in program INI file ΓòÉΓòÉΓòÉ
  402.  
  403. When option is selected, the current configuration information, the size and 
  404. location of the application window, the background and foreground colors, the 
  405. current font and font size are saved in the file named DHGREPPM.INI. 
  406.  
  407.  
  408. ΓòÉΓòÉΓòÉ 1.6. Start ΓòÉΓòÉΓòÉ
  409.  
  410. This selection on the menu bar is used to start the search.  The selection is 
  411. inactive until the search parameters have been entered and while the search is 
  412. in progress.  The 'Start' button on the 'Enter Search Parameters' dialog box 
  413. performs the same action as the selection on the menu bar. * 
  414.  
  415.  
  416. ΓòÉΓòÉΓòÉ 1.7. Stop ΓòÉΓòÉΓòÉ
  417.  
  418. This selection on the menu bar is used to stop the search.  The selection is 
  419. inactive until the search is in progress and becomes inactive when the search 
  420. has been completed or stopped.  A dialog box is displayed when 'Stop' is 
  421. selected and the user is asked to verify that he wants to stop the search. *