#!/bin/sh -eux # Fetch the first argument. word=$1; shift # Construct the URL to visit. url="https://www.oxfordlearnersdictionaries.com/definition/english/$word" # Dump the Web page as a plain text. w3m -dump $url | # Extract the (possible) word definition part. # NOTE: Assuming that the word definition is terminated by a section header. sed -n "/^$word/,/^See/p"