#!/bin/ksh # # This is a simple script to list the provenance of orbit blocks in a # Cluster orbit file. # # Arguments: # 1 - name of orbit file to scan # # This script generates a record for each set of orbit blocks with identical # provenance, i.e. same generation code and date. The records contain four # fields as follows: # a. generation code: R for reconstituted data or P for predicted # b. generation time as CCSDS ASCII code A # c. start time of the set as CCSDS ASCII code A # d. end time of the set as CCSDS ASCII code A # # Author: Mike Hapgood # # Revision # 12 Jul 2008 first version # # Check that we have the correct number of arguments if [ $# -ne 1 ]; then echo "Usage: $0 orbit_file_name" exit 1 fi # awk 'BEGIN {gen_date = "xx"; gen_code="yy"; start = "ss"; end = "ee"; cnt = 0} /T/ { if ((gen_date == $3) && (gen_code == $2)) {end_date = $5} else {{if (cnt>0) print gen_code, gen_date, start, end} ; gen_code = $2; gen_date = $3; start = $4; end = $5; cnt = cnt + 1}} END { print gen_code, gen_date, start, end }' $1 #