Sponsored Content
Top Forums Shell Programming and Scripting find all man dirs and build windex... HELP! Post 68006 by tonlu on Wednesday 30th of March 2005 06:53:53 AM
Old 03-30-2005
Question find all man dirs and build windex... HELP!

Hi all,

My goal is to find all my 'man' dirs in my sw structure and from that create a windex db. I get many new software dirs every week soo I need to rebuild the windex db very often. I've started with this:

OS: Solaris 8

#!/bin/bash

find /sw/tools -type d -name 'man*' -print

/sw/tools/matlab/7.0.1/man
/sw/tools/gnat/5.01a/man
/sw/tools/gnu/man
etc...

How can I make this list suitible for a varible like MANPATH like:

/sw/tools/matlab/7.0.1/man:/sw/tools/gnat/5.01a/man:/sw/tools/gnu/man...

If I get a complete MANPATH list I will be able to build a windex db with catman. Will the awk or nawk command be able to do what I want, and if soo, how?

Please help me... Smilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

using grep to find a value in current dir and sub dirs?

Hey guys, I would like to find all files which contain "client1.dat". I would like to search from the current directory and all subs and print out all the files that have this. Any help would be greatly appreciated. Thanks much. (10 Replies)
Discussion started by: ecupirate1998
10 Replies

2. Shell Programming and Scripting

script find files in two dirs HELP

I have a directory which is /home/mark/files/ , inside this particular I have a bunch of filles (see examples below) TST_SHU_00014460_20090302.txt TST_SHU_00016047_20090302.txt TST_SHU_00007838_20090303.txt TST_SHU_00056485_20090303.txt TST_SHU_00014460_20090303.txt... (2 Replies)
Discussion started by: fierusbentus
2 Replies

3. Shell Programming and Scripting

Find most recent files in dirs and tar them up?

Hey all.. This should be simple but stoopid here can't get head around it! I have many directories, say 100 each with many files inside. I need a script to traverse through the dirs, find most recent file in each dir and add it to a tar file. I can find the files with something like for... (1 Reply)
Discussion started by: bobdung
1 Replies

4. Shell Programming and Scripting

Find command and pruning .dirs

I'm sure this has been asked before but I couldn't find it with the search. I have a script that looks for files and then moves to another location for further processing. My problem is I can't seem to prune the .s* directories. It doesn't break anything just wanted a cleaner process. Here... (4 Replies)
Discussion started by: jcalisi
4 Replies

5. OS X (Apple)

how to find a string in file under multiple level dirs

Hi, i am asking a command to find a string in file(s) from multiple level directory structures. help would be really appreciated. (4 Replies)
Discussion started by: ywu081006
4 Replies

6. UNIX for Dummies Questions & Answers

**HELP** how to do a listing of dirs and all sub dirs only

I am trying to get a listing of ALL directories only under /export (as an example). I can get all the dirs directly under /export but I need any sub dirs under those dirs. I've looked (here and google) but can not find anything that works (4 Replies)
Discussion started by: bbraml
4 Replies

7. Shell Programming and Scripting

how to use use /usr/bin/find for 4 digit year dirs only

I have lots of directories in ~/. My diaries are stored in directories in ~/ containing exactly 4 digits. How do I use the /usr/bin/find command to only search my diary directories? So I would like my search to include ~/2009/abc/def and ~/2010/2001/33 but not ~/103/ or ~/20101/ or ~/201/... (2 Replies)
Discussion started by: siegfried
2 Replies

8. Emergency UNIX and Linux Support

find all the dirs starting with particular name

Hi Experts, I want to find all the dirs , subdirs on the sever which start with "sr". Can anyone let me know command for the same. find . -type d -name sr* I tried this but it is not working. Thanks, Ajay (4 Replies)
Discussion started by: ajaypatil_am
4 Replies

9. UNIX for Dummies Questions & Answers

Unix man command to find out month of the year?

how can i display month of the year i was born with using man command? thanks (2 Replies)
Discussion started by: janetroop95
2 Replies

10. UNIX for Dummies Questions & Answers

Looking for command line to find dirs based on size and date

Hi, My first time on this site, please excuse me if I've come to the wrong forum. I'm fairly new to Unix/Linux and hoping you can help me out. I'm looking for a command line that will return a list of directories that are larger than 50M and older than 2 days. I thought it may be... (6 Replies)
Discussion started by: Wisconsingal
6 Replies
catman(1M)                                                System Administration Commands                                                catman(1M)

NAME
catman - create the formatted files for the reference manual SYNOPSIS
/usr/bin/catman [-c] [-n] [-p] [-t] [-w] [-M directory] [-T macro-package] [sections] DESCRIPTION
The catman utility creates the preformatted versions of the on-line manual from the nroff(1) or sgml(5) input files. This feature allows easy distribution of the preformatted manual pages among a group of associated machines (for example, with rdist(1)), since it makes the directories of preformatted manual pages self-contained and independent of the unformatted entries. catman also creates the windex database file in the directories specified by the MANPATH or the -M option. The windex database file is a three column list consisting of a keyword, the reference page that the keyword points to, and a line of text that describes the purpose of the utility or interface documented on the reference page. Each keyword is taken from the comma separated list of words on the NAME line before the `-' (dash). The reference page that the keyword points to is the first word on the NAME line. The text after the - on the NAME line is the descriptive text in the third column. The NAME line must be immediately preceded by the page heading line created by the .TH macro (see NOTES for required format). Each manual page is examined and those whose preformatted versions are missing or out of date are recreated. If any changes are made, cat- man recreates the windex database. If a manual page is a shadow page, that is, it sources another manual page for its contents, a symbolic link is made in the catx or fmtx directory to the appropriate preformatted manual page. Shadow files in an unformatted nroff source file are identified by the first line being of the form .so manx/yyy.x. Shadow files in the SGML sources are identified by the string SHADOW_PAGE. The file entity declared in the shadow file identifies the file to be sourced. OPTIONS
The following options are supported: -c Create unformatted nroff source files in the appropriate man subdirectories from the SGML sources. This option will overwrite any existing file in the man directory of the same name as the SGML file. -n Do not create (or recreate) the windex database. If the -n option is specified, the windex database is not created and the apropos, whatis, man -f, and man -k commands will fail. -p Print what would be done instead of doing it. -t Create troffed entries in the appropriate fmt subdirectories instead of nroffing into the cat subdirectories. -w Only create the windex database that is used by whatis(1) and the man(1) -f and -k options. No manual reformatting is done. -M directory Update manual pages located in the specified directory, (/usr/share/man by default). If the -M option is speci- fied, the directory argument must not contain a `,' (comma), since a comma is used to delineate section numbers. See man(1). -T macro-package Use macro-package in place of the standard manual page macros, ( man(5) by default). OPERANDS
The following operand is supported: sections If there is one parameter not starting with a `-', it is taken to be a space separated list of manual sections to be pro- cessed by catman. If this operand is specified, only the manual sections in the list will be processed. For example, catman 1 2 3 only updates manual sections 1, 2, and 3. If specific sections are not listed, all sections in the man directory specified by the environment variable MANPATH are processed. ENVIRONMENT VARIABLES
TROFF The name of the formatter to use when the -t flag is given. If not set, troff(1) is used. MANPATH A colon-separated list of directories that are processed by catman and man(1). Each directory can be followed by a comma- separated list of sections. If set, its value overrides /usr/share/man as the default directory search path, and the man.cf file as the default section search path. The -M and -s flags, in turn, override these values. FILES
/usr/share/man default manual directory location /usr/share/man/man*/*.* raw nroff input files /usr/share/man/sman*/*.* raw SGML input files /usr/share/man/cat*/*.* preformatted nroffed manual pages /usr/share/man/fmt*/*.* preformatted troffed manual pages /usr/share/man/windex table of contents and keyword database /usr/lib/makewhatis command script to make windex database /usr/share/lib/tmac/an default macro package ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWdoc | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
apropos(1), man(1), nroff(1), rdist(1), rm(1), troff(1), whatis(1), attributes(5), man(5), sgml(5) DIAGNOSTICS
man?/xxx.? (.so'ed from man?/yyy.?): No such file or directory The file outside the parentheses is missing, and is referred to by the file inside them. target of .so in man?/xxx.? must be relative to /usr/man catman only allows references to filenames that are relative to the directory /usr/man. opendir:man?: No such file or directory A harmless warning message indicating that one of the directories catman normally looks for is missing. *.*: No such file or directory A harmless warning message indicating catman came across an empty directory. WARNINGS
If a user, who has previously run catman to install the cat* directories, upgrades the operating system, the entire cat* directory struc- ture should be removed prior to running catman. See rm(1). Do not re-run catman to re-build the whatis database unless the complete set of man* directories is present. catman builds this windex file based on the man* directories. NOTES
To generate a valid windex index file, catman has certain requirements. Within the individual man page file, catman requires two macro lines to have a specific format. These are the .TH page heading line and the .SH NAME line. The .TH macro requires at least the first three arguments, that is, the filename, section number, and the date. The .TH line starts off with the .TH macro, followed by a space, the man page filename, a single space, the section number, another single space, and the date. The date should appear in double quotes and is specified as "day month year," with the month always abbreviated to the first three letters (Jan, Feb, Mar, and so forth). The .SH NAME macro, also known as the NAME line, must immediately follow the .TH line, with nothing in between those lines. No font changes are permitted in the NAME line. The NAME line is immediately followed by a line containing the man page filename; then shadow page names, if applicable, separated by commas; a dash; and a brief summary statement. These elements should all be on one line; no carriage returns are permitted. An example of proper coding of these lines is: .TH nismatch 1M "10 Apr 1998" .SH NAME nismatch, nisgrep - utilities for searching NIS+ tables SunOS 5.10 27 Feb 1998 catman(1M)
All times are GMT -4. The time now is 12:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy