#!/bin/bash

# put out the originating <ul> tag
echo "<ul>"

# assign links file to fd 3
exec 3< $1

while true
do
	# read the name
	read <&3 name

	# if we have unsuccessfully tried to read the name
	# there won't be a link either so skip out of here
	if [ $? != 0 ]; then
		break
	else
		read <&3 link
		echo -e "\t<li><a href='$link'>$name</a></li>"
	fi

done

# put out the closing </ul> tag
echo "</ul>"
