#!/bin/bash # Appends the title of a URL in the format of # "# Title\nURL\n\n" while read -r URL; do TITLE=`curl -L "$URL" | grep -o ".*" | sed -E "s/(.*)<\/title>/\1/"` printf "# $TITLE\n$URL\n\n" done