#!/bin/sh
major="$(echo "$1" | sed 's/\..*//' | tr a-z A-Z)"
for i in a b c; do
  wget -q -O- http://student.mit.edu/catalog/m"${major}${i}".html | sed -n 's/^<p><h3>//p'
done | grep -Ei "^${1}J? "
