#!/bin/sh cp newfull withoutmate while read -r i; do sed /^"${i}"$/d withoutmate > bof mv bof withoutmate done < mate