aboutsummaryrefslogtreecommitdiff
path: root/bin/urlmt.sh
blob: 69bef5f79cfbe59186f50247eb6afe19e417de2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
# Get the MIME type for a given URL
self=urlmt
if [ "$#" -ne 1 ] || [ -z "$1" ] ; then
    printf >&2 '%s: Need a single URL\n' \
        "$self"
    exit 2
fi
url=$1
curl --head --output /dev/null --write-out '%{content_type}\n' "$url" |
    awk -F\; '{print $1}'