Next / Previous / Contents / Shipman's homepage

7.4. The showstas script: Look up station codes

The showstas script is a standalone program that queries the authority file described in Section 2.4, “MAPS stations authority file”.

This script was written to address these needs:

There are two ways to run this script:

showstas location-code
showstas station-no

In the first form, you supply a four-letter location code, and you get a list of all the stations in that location. In the second form, you supply a five-digit station number, and you get a list of all the stations in the same location. In either case, the operator's name and phone number is shown, if known.

Examples:

$ showstas yose
  YOSE.BIME 11905 Big Meadow [John Doe, 415-555-1212]
  YOSE.CRFL 11907 Crane Flat [John Doe, 415-555-1212]
  YOSE.GFEM 11980 Gin Flat East Meadow [John Doe, 415-555-1212]
  YOSE.HODG 11107 Hodgdon Meadow [John Doe, 415-555-1212]
  YOSE.TAME 11906 Tamarack Meadow [John Doe, 415-555-1212]
  YOSE.WHWO 11904 White Wolf [John Doe, 415-555-1212]
$ showstas 11904
  YOSE.BIME 11905 Big Meadow [John Doe, 415-555-1212]
  YOSE.CRFL 11907 Crane Flat [John Doe, 415-555-1212]
  YOSE.GFEM 11980 Gin Flat East Meadow [John Doe, 415-555-1212]
  YOSE.HODG 11107 Hodgdon Meadow [John Doe, 415-555-1212]
  YOSE.TAME 11906 Tamarack Meadow [John Doe, 415-555-1212]
  YOSE.WHWO 11904 White Wolf [John Doe, 415-555-1212]
$ showstas 13401
  NONX.SLAB 13401 Big Concrete Slab [Jane Roe, 408-555-1212]

Note

File stations.txt, which is a flattened version of the MAPS stations authority file (see Section 2.4, “MAPS stations authority file”), or a soft link to that file, must be in the directory where the script is run. For information on flattening a dBASE V file, see Section 7.3, “The dbflatten script: Flatten a dBASE V file”.