#!/bin/sh
#
# Filename:  index_points.script
#
# Author:  Kevin FitzGerrell
# Comments to:  kfitz@gci.net or fitzgerrell@yahoo.com
# 
# Usage:  This script should be located in the directory that contains all graphics
# screen files or the parent directory of the subdirectories containing those graphics 
# files.  This script should be made executable and run with no parameters.  
#
# Description:  This will generate data files in table form showing graphic files and their 
# COMPOUND:BLOCK.PARAMETER (C:B.P) connections.  Some connections will not listed.
# These will include:  implied connections (.PARAMETER or BLOCK.PARAMETER), relative picks,
# global variable substitution connections, substitution list connections.  
#
# Created files:  "connect_screen.txt" and "connect_point.txt" will be created in the 
# directory this is run in.  Intermediate files "temp.1" and "temp.2" will be removed.
# Ensure that these filenames will not create a conflict in the directory this is run in.
#



# Working in the current directory and all descendent directories generate a connection
# report on each graphics file using the Foxboro Display Reporter tool (d_edit50).
find . -exec /usr/fox/wp/bin/tools/d_edit50 -l {} > temp.1 \;

# strip out lines that do not have compound:block.parameter references, keep filename, strip out leading info.
egrep '(^ */|^[ 0-9][ 0-9][0-9].*:.*\.)' temp.1 | sed 's$^ */$%/$g' | awk '{print $NF}' | sed 's/%/% /g' > temp.2

# generate listing in form "FILENAME COMPOUND:BLOCK.PARAMETER" of all points located to file "connect_screen.txt".
awk '{if ( $1 == "%" ) fname = $2; else print fname " " $1}' temp.2 | sort -u > connect_screen.txt

# generate listing in form "COMPOUND:BLOCK.PARAMETER FILENAME" of all points located to file "connect_point.txt".
awk '{if ( $1 == "%" ) fname = $2; else print $1 " " fname}' temp.2 | sort -u > connect_point.txt

# remove intermediate files
rm temp.1
rm temp.2

    Source: geocities.com/fitzgerrell/dcs_stuff

               ( geocities.com/fitzgerrell)