I had a need to look up callsign information from the command line, so I wrote some scripts that take callsigns either as arguments or from standard in (stdin) and return the callsign followed by the operator's name. An example: $ callsign k6rwh K6RWH, Robert W Harder The script itself is simple because the hard work is done by Callook.info from Joshua Dick W1JDD, and the only reason the download is more than copying and pasting a few lines is that I wanted to convert the callsigns to titlecase, and that turned out to be more extravagant. I also use this to take notes during Nets in my favorite (gui) text editor TextMate. I can scribble down callsigns and then process them at once. If you're looking for a vanity callsign, you might also try running through a for loop to see which variations are available: $ for N in 0 1 2 3 4 5 6 7 8 9; do callsign K${N}RWH; done K0RWH, K1RWH, Richard W Hazzard K2RWH, Richard W Holst K3RWH, K4RWH, Rodney W Humphries K5RWH, Randall Harwell K6RWH, Robert W Harder K7RWH, Richard W Hassler K8RWH, Roy W Hale K9RWH, DownloadDownload the three files: callsign_titlecase.tgz The ScriptHere's the script. Note that the titlecase command is itself a big, involved script I found somewhere (and is included in the download file above). You can change the last echo command to echo $CS, $NAME if you don't care about titlecasing. #!/bin/sh # Command can be called with arguments or to read from stdin # Author: Robert Harder K6RWH # With thanks to Joshua Dick W1JDD # Echoes callsign and name of the operator function _callsign { local CS=$(echo $1 | tr "[:lower:]" "[:upper:]") local NAME=$(curl -s "http://callook.info/index.php?callsign=${CS}&display=text" | grep -A 1 'Name + Address' | grep -v 'Name + Address' | tr -d '\t') echo $CS, $(echo $NAME | /usr/bin/env titlecase) } # Checks arguments if [ $# -ge 1 ] # Callsigns passed in as arguments then for cs in $@; do _callsign "$cs" done else # Callsigns read from stdin xargs $0 fi exit 0 Here is an alternate Python version #!/usr/bin/env python3 ExplanationAgain, all the hard work is done by Joshua Dick's online service. He imports the FCC database regularly and makes it available as a web service. The curl command retrieves the station's record in text form, and a series of piped grep calls pulls out the name. Here is what the web service returns without the piping: $ curl 'http://callook.info/index.php?callsign=K6RWH&display=text' Type: PERSON Callsign: K6RWH Class: TECHNICIAN Previous Callsign: KJ6CTJ Name + Address: ROBERT W HARDER 123 MAIN ST MONTEREY, CA 93940 Location: Latitude: 36.57 Longitude: -121.87 Grid Square: CM96b Other License Information: Effective: 11/06/2009 Expires: 11/06/2019 Last Action: 11/06/2009 FRN: 0012345678 The first grep filters out the "Name + Address" line plus one following line (the person's name). The second grep filters lines that do not match "Name + Address." Do the math, and you are left with the station's name. Finally a simple translate command removes the leading tab. |