source: SH_SHM/trunk/util/statlist_build.sh @ 92

Revision 16, 2.5 KB checked in by marcus, 15 years ago (diff)

r1 | svn | 2007-12-13 11:10:29 +0100 (Do, 13 Dez 2007) | 2 lines

Initial import

  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3####################################################################
4# STATLIST_BUILD Ver. 1.0   Karl Koch, BGR-B3.11 Date: Jan 30,1997 #
5# This command file reads an SFD file and build from the stations  #
6# included there a STATLIST_SFD.STX file that can be used in SHM   #
7# There will be one Array button called SFDFILE                    #
8#                                                                  #
9# =======>  Seismological Data Analysis Center  <===============   #
10#                                                                  #
11# For command syntax type: statlist_build -h                       #
12#                                                                  #
13# Last Updated: Jan 30, 1997                                       #
14####################################################################
15
16####################################################################
17# Step 1: Get command line parameters
18####################################################################
19
20if [ "$#" -gt "0" ]
21then
22        case $1 in
23                -h) echo "usage: statlist_build [-h] [sfdfile1 sfdfile2 .... sfdfileN]";
24        echo " ";
25        echo "Option: -h...... this commmand syntax help";
26        echo "  ";
27        echo "   other command line paramters are assumed";
28        echo "   to be sfdfiles; if no parameters are given";
29        echo "   then ./sfdfile.sfd  is assumed";
30        exit 0;;
31                *) FILES="$*";;
32        esac
33else
34                FILES="./sfdfile.sfd"
35fi
36
37####################################################################
38# Step 2: Do the job ; store the result in STATLIST_SFD.STX
39####################################################################
40
41umask 002             # Remove write permission for 'others'
42
43echo "! file STATLIST_SFD.STX"   >  STATLIST_SFD.STX
44echo "! !      ================" >> STATLIST_SFD.STX
45echo "! !"                       >> STATLIST_SFD.STX
46echo "! ! version 1, 18-Aug-94"  >> STATLIST_SFD.STX
47echo "! !"                       >> STATLIST_SFD.STX
48echo "! ! Setup for read dialog box from SFD file" >> STATLIST_SFD.STX
49echo "! ! K. Koch, 30-Jan-94 [`date '+%d-%h-%y'`]" >> STATLIST_SFD.STX
50echo ""                          >> STATLIST_SFD.STX
51echo "set1: 0 29 SFDFILE"        >> STATLIST_SFD.STX
52echo ""                          >> STATLIST_SFD.STX
53
54# The head -30 is used in order to avoid messy SHM errors
55cat $FILES | dd conv=ucase 2> /dev/null | grep 'S>' | \
56        cut -d' ' -f1 | cut -d'>' -f2 | cut -d'-' -f1 | sort -u | \
57        awk '{print "* "$1}' | head -30 >> STATLIST_SFD.STX
Note: See TracBrowser for help on using the repository browser.