vic@uis-oc.UUCP (Victor Torres) (04/27/91)
Hello, I'm using a Unisys System V 3.2 on a Unisys PW2 800/33 (33 Mhz 386). I've got two questions I need some help on. First, in reading the man page on finger(1B) it makes reference to two files that live in $HOME, .plan and .project. But unfortunately, the man page doesn't say anything beyond that it looks at both these files. I'm curious to find out what these files are used for and if other utilities make use of them. I manage a small software group here and if this is something that could make coordinating my group easier, I would love to use it. Please don't tell me to RTFM. I've looked all over the FMs. My second question is, in trying to find other utilities that referenced .plan and .project, I had the idea of grep'in all the man pages looking for a match. Since the man pages are compressed, I did the following: find /usr/catman -type f -exec pcat {} \; | grep project Unfortunately, whenever grep finds a match, it doesn't tell me what file the match is in. I haven't been able print only the filenames that grep finds a match. If someone can help, I would appreiciate it. -- ----------------------------------------------------------------- Victor Torres (714)727-0318 Unisys ..!uunet!ccicpg!uis-oc!vic -----------------------------------------------------------------
jik@athena.mit.edu (Jonathan I. Kamens) (05/01/91)
In article <61@uis-oc.UUCP>, vic@uis-oc.UUCP (Victor Torres) writes: |> [What are .project and .plan, and which programs reference them?] At this point, .project and .plan are simply two files that "finger" displays when someone fingers you. .plan can have as much text as you want in it, and .project is supposed to be one line long. Also, some versions of finger will look for the string %MENTION-MAIL% in the .plan file, and mention whether or not you have unread mail if it's there. Besides the fact that finger looks at them, there's nothing special about them, and (as far as I know) no other programs look at them. |> [How to pcat files in a directory tree and grep through them, displaying |> the filenames on lines that match.] I have a script "zfiles" that looks like this: #!/bin/csh -f set sed = /bin/sed set zcat = /usr/ucb/zcat foreach file ($argv[2*]) $zcat $file | $argv[1] | $sed 's&^&'"$file"':&' end Using a script like this, and assuming you have "xargs" (if you don't, there are freely redistributable versions available on the net) you can do something like: find /usr/catman -type f -print | xargs zfiles "grep project" In other words, there is no way to tell find to only print the filenames that grep finds matches for, so you've got to generate the filenames with find, and then use something else to do the searching through them and printing filenames where appropriate. Something you have to watch out for when searching through man pages is that many of the keywords are underlined, and "grep" won't find them. For example, the word "project" in a man page may appear as "_^Hp_^Hr_^Ho_^Hj_^He_^Hc_^Ht", which grep won't locate when you tell it to search for "project". You could probably get around this by changing "grep project" to "col -b | grep project" in the command I included above. -- Jonathan Kamens USnail: MIT Project Athena 11 Ashford Terrace jik@Athena.MIT.EDU Allston, MA 02134 Office: 617-253-8085 Home: 617-782-0710