#!/bin/sh # RemoveFromList.sh # 2007-02-29 # Chieh Cheng # http://www.CynosureX.com/ # Removes a list of items in a file from # another list of items in another file. # GNU General Public License (GPL), Version 2, June 1991 scriptName=`echo $0 | sed s/\\\\/.*\\\\///g` if [ $# -ne 2 ] then echo " Usage: ${scriptName} \"Remove List File\" \"Main List File\"" exit fi removeList="$1" mainList="$2" if [ -f "${removeList}" -a -f "${mainList}" ] then tempFile=`GetTempPathName.ksh "${scriptName}"` cp "${removeList}" "${tempFile}" cat "${removeList}" >> "${tempFile}" cat "${mainList}" >> "${tempFile}" cat "${tempFile}" | sort | uniq -u > "${mainList}" rm "${tempFile}" else echo "${scriptName}: ${removeList} and/or ${mainList} do not exist!" fi