Home
Research Projects
Classes GEOS 293/393 Hawaii Field Course GEOS 436/636 Beyond the Mouse GEOS 602 Geophysical Fields GEOS 620 Geodynamics GEOS 655 Tectonic Geodesy GEOS 692 Geophys. Seminar
Current & Past Students
Student Opportunities
Curriculum Vitae
Recent Publications
Info for Surveyors
Personal Info

Climb higher, beyond the mouse...


Beyond the Mouse LAB 8: Unix Tools 2

October 31, November 2

Instructor: Jeff Freymueller

x7286 Elvey 413B jfreymueller@alaska.edu

TA: Matvey Debolskiy

Last Updated: October 10, 2017

Due: Tuesday Nov 8 before class

Lab slides

none.

Note

As solution, send me your scripts and the answers to the questions. No datafiles please, I have plenty of those :)

Running the VirtualBox

Check here if you forgot how that works. Really. Go there if you forgot something.

Exercise 1: Data Handling with awk

Hopefully you remember Exercise 2 of Lab 05. If not, you may remember that, at some point in the past, we had you fiddle with pesky formatting strings to extract some data from a file with a lot more data. Now we'll go back to the FAIR.pfiles.txt text file and treat it with Unix tools to extract the information we want.

Now that you know how to do those two key actions, create a new tcsh script pfiles2llh in $BTM_BIN, which generalizes this for any .pfiles file it gets as a command line argument. The format for executing this script at the command line should be like this:

> pfiles2llh STATION_NAME.pfiles

Command line arguments are given to a script in various forms. ONE is using the built-in variables $0, $1 ... $N. Inside your script $0 is the program name that has been called. $1, $2, ..., $N are the first argument, 2nd, ..., n-th argument for the program that has been called. This convention is generally used when you have a few arguments that you expect to be handed to the script in a certain order. Here is an interesting article that tells you how to find the maximum number of arguments for a shell command, if you are curious.

Here's what your script is expected to do:

Exercise 2: More Data Handling with awk

For this exercise, you will do some further manipulation of the FAIR.pfiles.txt file. Columns 4, 5, 6 of this file are the longitude, latitude and height data for each day, in decimal degrees and meters. Columns 7, 8, 9 are the uncertainties in the east, north, and vertical component estimates, in mm.


Dr. Jeffrey T. Freymueller
Professor of Geophysics
Geophysical Institute
University of Alaska, Fairbanks
Fairbanks, AK 99775-7320

jfreymueller -at- alaska.edu
Phone 907-474-7286
Fax 907-474-7290
Office 413B Elvey