+--------------------------------------------------------------------------+ | | | Installation Utilities Menu | | README file | | | | Updated by: Jerry Rains - March 15, 2001 | | | +--------------------------------------------------------------------------+ The Installation Utilities Menu is a result of recommendations made during the writing of the new 5.0 Install. Several people mentioned to me that the printer, edits, config and user config routines in the install would be better as separate subroutines. Others mentioned that they would like to be able to run these and the index rebuilding routines separately. This Menu has all of that and much more. Options 1 through 9 are improved versions of the routines that are in the new 5.0 Install. Options A through H are utility programs that I think are valuable. I would like to acknowledge the help I received from Bob Stockler and Joe Chasan. Bob allowed me to include several of his scripts and helped me to solve some of the problems caused by placing them in a menu environment and modifying them to work under 'bash' on Linux. Joe had many excellent suggestions and observations that made the menu better. +--------------------------------------------------------------------------+ | The rest of this README is a compilation of the hlp files from this menu.| | Each section head will start with 5 -'s, followed by the Menu selection | | character. You can use that to search for the section you wish to review.| +--------------------------------------------------------------------------+ ----- Setting up the environment ----- The util-8 menu entry allows you to set PFPROG and PFDIR so that you can use the tools in the Installation Utilities Menu on any filePro filesystem with any set of filePro binaries you wish. These routines have been tested with filePro 4.8 and 5.0. There are a number of Bob Stockler's sripts which use /bin/ksh. These scripts have been modified to work using bash and have been tested on OSR5.0.5 and RH7.0. To test to see if your Linux has ksh type: type ksh If ksh is not found you will have to make a symbolic link to bash. Find the location of bash by typing: type bash Make a note of the filename returned, probably /bin/bash. Then make a symbolic link to bash: ln -s /bin/bash /bin/ksh Or, you can install ksh. The tools included in the Installation Utilities Menu include an assortment of utilities that make editing printers, edits and the config file easier. Assist in making User config files. Document and generate a rebuild index script and Install Sample & Tutorial files. (Left side of menu). Also, the following programs in $PFPROG/fp/util/bin can be used from the command line: ASCIIfy - Unencrypt prc. table. cabe - Encrypt or Unencrypt all tables in a filePro file. ck.prc - Check Encrypted status of all tables in a filepro file. ck.syn - Check for text editor and filepro syntax errors. ck_prc - Wrapper for ck.prc to check any or all filePro files. cmap - See a filePro map. e - Edit a prc. table. lock.info - Determine EXACTLY which file, user, tty, record is locked. search - Find a string anywhere in a filePro file system. searchr - Find a string in the current working directory. set_echo - Find out the proper version of echo to use. sl - Monitor for locked records every 15 seconds. viewprt - View/print a file. Can browse directories in interactive mode. whence - Bourne shell version of the ksh builtin. ----- 1 - Add/Edit Printers ----- This menu item will assist in setting up printers. It only works for OSR5 and Unixware. ----- 2 - Clean/Update Edits Files ----- This menu item assists in editing any Edits file. When first launched it calculates the total number of edits in the Global Edits file and all Local Edits files and displays a list of all Edits files found in the current filepro filesystem. You can edit any of these files. Also, you can enter the location of any Edits file on the server. The largest Local Edits file is remembered and the program will not allow you to add more than 200 total edits. All 'slave' edits are now linked to their respective 'master' edits. For example STPROV has slave edits STATE and PROV. If STPROV is not in your Global Edits file and you want to add it STATE and PROV would also be selected to be added automatically. By the same token if you tried to remove STATE you would be informed that it is a slave edit to STPROV and would not allow the deletion. For a full description of its features, see its help file. The operation of this program and the config file program -3 is very similar. ----- 3 - Environment Variables/Config ----- This menu item assists in editing the config file. It includes all Environment variables, most with a suggested value. If the variable is normally included in the config file then the suggested value will be the recommended value (PFTOKSIZE, PFCMARK, etc.). If the variable is not normally included in the config file then the suggested value will be the value required to activate the variable (PFCHECKLOCK, ABE, PFADDWP, etc). All variables have help screens. Color variables will display a sample of the color that can be changed by pressing + or -, which increments or decrements the value. There are 3 views: Sort by Label, Sort by Group and Sort by order. For a full description of its features, see its help file. The operation of this program and the edits file program -2 is very similar. ----- 4 - Setup User Configuration Files ----- This menu item assists in setting up User Configuration Files. Since the manipulation of the config file is the same as item -3 this item shares the same code, except the final destination is a user config file. ----- 5 - Install Sample & Tutorial Files ----- This menu item will install the Sample and Tutorial files. ----- 6 - Bob Stockler's new 'ndx' program ----- This menu item runs Bob Stockler's 'ndx' program. ----- 7 - Run 'docindex' and make 'rbldindex' ----- This menu item runs Marc Parnes' and Bob Stockler's docindex, then Nancy Palmquists' reindex.script. I made small modifications to both scripts to use them with this menu. These modifications are documented in the scripts - Jerry Rains. docindex generates two reports PFDATA/PFDIR/report1 and PFDATA/PFDIR/report2 report1 is in this format, for documentation: ============================================================ Documenting 6 filePro Indexes - Fri Apr 17 17:17:17 EDT 1998 ============================================================ FILENAME: address INDEX: index.0 [4.x] Sort1 on Field 2 - Len 4 - Des - Category Sort2 on Field 5 - Len 18 - Asc - Sort Name Built on 60 records. INDEX: index.1 [4.x] Sort1 on Field < Dummy Field > - Len 15 - Asc Sort1 on Field < Dummy Field > - Len 9 - Des Built on 60 records. INDEX: index.A [4.1] Sort1 on Field 5 - Len 18 - Asc - Sort Name Built on 59 records. INDEX: index.B [4.5] Sort1 on Field A0) - Len 5 - Asc - a) Account # Sort2 on Field 5 - Len 18 - Asc - Sort Name Built on 64 records. INDEX: indexqual.A [4.1] Sort1 on Field 5 - Len 18 - Asc - Sort Name Built on 106 records. INDEX: indexqual.B [4.5] Sort1 on Field A0) - Len 5 - Asc - a) Account # Sort2 on Field 5 - Len 18 - Asc - Sort Name Built on 106 records. report2 is in a format suitable for reading by a script to hand information to 'dxmaint' to rebuild an index: 4.x address 0 2,4,d:5,18,a 4.1 address A 5,18 4.5 address B A0),5:5,18 4.1 address A 5,18 qual 4.5 address B A0),5:5,18 qual reindex.script uses PFDATA/PFDIR/report2 to generate a script suitable for running from a menu. I have modified reindex.script so that it generates the menu script for menu item -8. ----- 8 - Display Index Documentation ----- This menu item displays the Menu Documentation generated by item -7 above. ----- 9 - Run 'rbldindex' script ----- This menu item runs PFDATA/PFDIR/rbldindex generated by item -7 above or by the new 5.0 install. The 'rbldindex' script from the install uses 'dxmaint -ra' which requires the indexes to exist. The 'rbldindex' generated by Bob's docindex script uses 'dxmaint -rf' which will regenerate an index even if it has been deleted. 'rbldindex' is located in the $PFDATA$PFDIR directory. ----- A - View a filePro map (cmap) ----- This menu item runs Jerry Rains' 'cmap' program. 'cmap' was designed to be used from the shell and was modified to work from this menu. However, when used from a menu it can only be used to display maps pointed to by PFDATA/PFDIR. If the map you want to view isn't in the current PFDATA/PFDIR exit back to the util menu and run item -8 and set PFDIR to the proper PFDATA/PFDIR location. In the Installation Utilities PFDATA will always be null. 'cmap' displays filePro maps using the same format as used by ddefine. However, it uses a pager (preferably 'less') so you can scroll and search. In order to look at another map press or to exit the pager. The list of files will be redisplayed. If there are many filepro files you can type the first letter or two of the name you want, or you can use metacharacters, for example: [a-n] to see those files starting with a through n. In order to see the map you MUST type the entire filename. Press 'break' from the 'Enter filename:' prompt to exit cmap. To use 'cmap' from the command line: 1) set PFDATA and PFDIR in the environment, or 2) run 'cmap' while sitting in a ./filepro directory. Sitting in a ./filepro directory takes precidence over PFDATA/PFDIR Usage: cmap [-h | filename] ----- B - Search for a string (search) ----- This menu item runs Jerry Rains' 'search' program. 'search' is a program that will find a 'string' in a filePro filesystem. In all modes, any occurance of the 'string' is logged in $tmpdir/found. Upon completion of the search the $tmpdir/found file is displayed. There is a companion program 'searchr' that will search (and replace) in the current working directory. It is only available from the command line. It is in $PFPROG/fp/util/bin. Otherwise it operates exactly like 'search'. Usage: search 'search string' [ 'replace string' ] 'search' has 5 modes of operation: Find a 'string' and display. (default) Find a 'string', display and pause. Find a 'string' and enter vi to edit the file the string is in. Find a 'string', display, pause, then exit. Find a 'string' and replace with another 'string'. The following file types are excluded from the search: key, index, tok, sel, map, screen, out, cpio and gz. The first time 'search' is run it will generate a search.PFQUAL file. If qualifiers are not used the file will be called 'search.list'. This file can be customized. If you don't use qualifiers it will be overwritten if you change PFDIR. The 'search.list' file is kept in the same directory that contains 'search'. When running 'search' from the shell enclose special characters in single quotes. search '\"7\",\"2\"' This is not necessary when running from a menu. To use 'search' from the command line: 1) set PFDATA and PFDIR in the environment, or 2) run 'search' from a ./filepro directory. Sitting in a ./filepro directory takes precidence over PFDATA/PFDIR. In order to use 'search' prc. tables must have been saved in ascii format. There are two special files in the parent of the ./filepro directory that are used to determine if there are any ENCODED prc.'s (ASCII_ENCODED and ENCODED). These files are set by menu item -F (ck_prc's (all) function). They are also set by menu item -D (cabe) which calls 'ck_prc -q' (quiet). 'search' checks for the existence of these files and will call 'ck_prc -q' in it's quiet mode to generate them if they aren't there. ASCII_ENCODED contains the word ENCODED unless there are no encoded prc's, then it contains the word ASCII. If any prc's are ENCODED 'search' will ask if you want to decode them. If so another script Bob Stockler wrote for me, 'ASCIIfy', is used. If 'ASCIIfy' is used to decode the prc. tables ASCII_ENCODED and ENCODED files are deleted so that 'ck_prc -q' will be called to regenerate them the next time 'search' is run. 'ASCIIfy' will decode if ABE=ascii and encode if not. ----- C - Edit a prc. table (e) ----- This menu item runs Jerry Rains' 'e' program. 'e' is much more than just a wrapper for a text editor. 1) The editor to use can be changed to a different editor or to any executable program including 'dclerk' and 'dreport'. 2) PFDATA/PFDIR can be changed from within 'e'. 3) PFPROG can be changed from within 'e', allowing testing of prc.'s using different versions of filePro. 4) 'e' displays only valid filePro files. (file must have prc. tables). 5) Wildcards can be used to limit number of files or prc.'s displayed. 6) Encoded prc. tables are decoded on the fly (using Bob Stockler's ASCIIfy script), then reencoded on exit. 7) Syntax is checked using Bob Stockler's ck.syn script. 8) 'e' will create a prc. table if not found. 9) 'e' will delete an empty prc. table on exit. 10) 'e' will recognize and allow editing of DOS type .prc files. 11) 'e' can be run from the command line or a menu. 12) Running 'e' from within a ./filepro or ./filepro/filename directory will override PFDATA/PFDIR. 1) ----- To change the editor to 'less' enter: editor=less at the "Move to which file" or "Edit which table?" prompts. If the "editor" entered is not found or is not executable 'vi' is used. The "editor" can be: 1)Any executable program, 2)dclerk or 3)dreport. When 'less' is used as an editor you get highlited searches, and 'vi' is just one keystroke away . When 'dclerk' or 'dreport' are used as the editor you get limited testing of prc tables using: $PFPROG/fp/$editor $filename -z $prcname -db 2) ----- The filepro directory can be changed by entering the full pathname for PFDATA/PFDIR at the "Move to which file?" or "Edit which table?" prompts. If this directory also has a ./fp directory you will be asked if you want to change PFPROG also. It is best to make this change from the "Move to which file?" prompt as the "Edit which table?" prompt leaves the display in an indeterminate state. If change is made from the "Edit which table?" prompt enter <..> to return to the display of the ./filepro files. 3) ----- Enter PFPROG=[full pathname to ./fp directory] to change PFPROG by itself. This will allow you to easily test a prc table under different versions of filePro. 4) ----- When run without arguments 'e' displays a list of all filepro files with prc. tables. After selecting a filepro file it displays a list of all prc. tables within that file. 5) ----- If the ./filepro directory or a filePro file directory has many files you can use the first character or two of the filename or any other valid Wildcards to limit the number of files displayed. 6) ----- If a table is encoded 'e' will automatically decode it, then reencode it when editing is complete, using Bob Stockler's ASCIIfy program. 7) ----- Syntax is checked when you exit the prc. table using Bob Stockler's ck.syn script, which I modified to work with 'e'. I modified ck.syn so that it would recognize just the basename of a prc. table and so that if rcabe is on the system it prompts for creation of a runtime table. In addition to using 'dcabe' or 'rcabe' to check syntax, ck.syn checks for common syntax errors caused by using 'vi' such as too many or too few colon's, condition line or statement line too long, labels too long, too short, used more than once or with illegal characters (IF PFLABEL isn't OLD). If a syntax error is found 'e' prompts to reedit file. To run 'ck.syn' from the command line: cd "filePro file directory" ck.syn "prc table name" 8) ----- If a table does not exist you will be asked if you want to create it. If you agree the prc. table will be created and permissions set. 9) ----- If a table is empty it will be deleted upon exit. This is true even if 'e' did not create the table. 10) ----- If you use SAMBA or VisionFS and you place DOS filepro files onto the unix server you can use 'e' to edit *.prc files. You just have to be careful to keep the ^M on the ends of the lines. 11) and 12) ----- The following is the instructions on how to use 'e' from the command line. Do not include the prc. of the filename when starting 'e'. 'e' will automatically calculate the value of PFDATA/PFDIR if run from a ./filepro directory or from a ./filepro/file directory. This is done even if PFDATA and PFDIR are set in the environment. If you start 'e' from some other directory it will use the values of PFPROG, PFDATA and PFDIR that are set in the environment. If they are not set then 'e' will prompt for them. Enter the full PFDATA/PFDIR path for PFDIR. PFDATA will be set to null. ----- D - Unencode/Encode prc. tables (cabe) ----- This menu item uses Bob Stockler's 'cabe' script to Unencrypt/Encrypt most filePro files. If the file has a filePro error the script will hang but a QUIT (normally ) will save the table and allow the program to continue. Unlike earlier versions of 'cabe' it will not hang on a syntax error. This version has been modified to work under 'bash' if the Linux you are using doesn't have 'ksh'. See 'help' in util.-8. ------------------------------------------------------------------------- Usage= cabe [-f filename] [-a|-e] [-r$tok] -f filename - filename may be a quoted list of space separated filePro file names (including regular characters and/or shell metacharacters) -a - Save processing tables in ASCII format -e - Save processing tables encoded -r - Resave processing tables$Tok * Default flags are highlighted. * Executed with no arguments, the program is interactive. * Can be executed only by the user \"filepro\" or \"root\". * Tables processed are listed in a log file (/tmp/cabe.\$$). ----- E - Use 'viewprt' to view then print ----- This menu item will run Jerry Rains' 'viewprt' script. 'viewprt' was written to be used with the filePro PFPOSTPRINT environment variable. It displays a file using a pager. It will use 'less -S' if possible. 'less -S' has horizontal scrolling capability so your wide reports won't wrap. If 'less' is not found and PAGER is defined it will use $PAGER. Otherwise 'more' will be used. If a valid filename is supplied as an argument for 'viewprt' it will view/ print that file then exit. For this menu 'viewprt' was enhanced so that if a filename is not supplied it will display the '/' directory using 'ls -xdF' which will mark directories with a trailing '/', executables with a trailing '*', symbolic links with a trailing '@' and pipes with a trailing '|'. It is then possible to browse the directory structure of your server. If a directory name is supplied as an argument 'viewprt' will display that directory and if a non-existant filename is supplied 'viewprt' will display the directory that the file should have been in. When browsing directories, entering the name of a directory will move to that directory. Entering <..> will move up one directory. Entering or will exit the pager and you will be asked if you want to print the file. Enter or to print, , or to exit. To run 'viewprt' from the command line: viewprt (for interactive use) viewprt "full path to file" ----- F - Check prc. Encoding status ----- This menu item runs Jerry Rains' 'ck_prc' script. 'ck_prc' is a wrapper for Bob Stockler's 'ck.prc' script. 'ck.prc' is used to check to see if the prc tables are encrypted or not. 'ck_prc' allows you to check a single file or (all) files. The (all) option will put the output into $tmpdir/ckprc.log which will be viewed using 'viewprt' so that it can be printed if desired. (all) will also generate the ASCII_ENCODED and ENCODED files in the parent of the ./filepro directory that are used by 'search' to determine if the prc's need to be decoded. If a single file is requested the output will be viewed using a PAGER. 'ck_prc' also has a -q (quiet) option that will perform the (all) report non-interactively. This is used by menu item -D (cabe). To use ck_prc from the command line: ck_prc To use ck.prc from the command line: ck.prc "filePro file name" ----- G - Monitor Locked Records with 'sl' ----- This menu item runs Jerry Rains' 'sl' script. 'sl' is monitor program that checks for locked records every 15 seconds. It is a wrapper for 'showlock' which was written by Ken Brody. Binary versions of 'showlock' are included for SCO and Linux, however, if it doesn't run on your machine the source code is in $PFPROG/fp/util/bin/showlock.c. Instructions for compiling it are in showlock.c. 'sl' makes a list of all filepro 'key' files then checks these files every 15 seconds using 'fuser' to see if any of these files are in use. Any in use are then checked with 'showlock' for locked records. Other than a '.' every 15 seconds it produces no output unless there is a locked record. The output consists of the output from 'showlock' plus a time stamp followed by the output from 'ps -ef | grep PID' formatted to fit on a single line. From this information it should be easy to determine who has a record locked. If you want to know exact information you can run menu item -H (Bob Stockler's lock.info program) for the file that is locked. If there is more than one filePro filesystem on a computer 'sl' will show output only for the filePro filesystem defined when entering the Installation Utilities Menu from the filePro Util Menu. To monitor a different system exit the Installation Utilities Menu and change PFDIR to point to the filePro filesystem you want to monitor. To use 'sl' from the command line: sl ----- H - Bob Stockler's 'lock.info' script ----- This menus item runs Bob Stockler's 'lock.info' script. 'lock.info' will display "In plain English" the file that is locked, which record is locked, by whom, on which TTY, using which PID and using which command. In order to use 'lock.info' you have to know which file is locked. To determine that use menu item -G 'sl'. To use 'lock.info' from the command line: lock.info "filePro file name"