File: prog_use.sh

package info (click to toggle)
gmt 5.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 150,460 kB
  • ctags: 18,539
  • sloc: ansic: 194,217; sh: 7,349; xml: 149; makefile: 72; fortran: 49; lisp: 41; csh: 5
file content (22 lines) | stat: -rwxr-xr-x 804 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# $Id: prog_use.sh 12464 2013-11-06 15:58:22Z fwobbe $
# Returns a count of how many time a GMT program is used in our test scripts
# including doc and examples.  Give -l to see which scripts [Default returns the count]
#
. gmt_shell_functions.sh
# Determines in which test and example scripts each GMT module (incl supplement) is used
find . -name '*_func.c' -print | tr '/' ' ' | awk '{print $NF}' | sed -e s/_func.c//g > /tmp/t.lis
while read prog; do
	find . -name '*.sh' -exec grep -H $prog {} \; | sed -e 'sB/share/doc/gmtB/docBg' | awk -F: '{print $1}' | sort -u > /tmp/list
	n=`gmt_nrecords /tmp/list`
	if [ $# -gt 0 ]; then
		echo " "
		echo "-------------------"
	fi
	echo "===> $prog [$n]"
	if [ $# -gt 0 ]; then
		echo "-------------------"
		cat /tmp/list
	fi
done < /tmp/t.lis