#!/bin/bash if test "${#}" -ne 2; then printf "%s\n" \ "compare two files and output the difference" \ "usage: $(basename $0) " exit 1 fi if ! command -v comm &>/dev/null; then printf "%s\n" "comm not found" exit 1 fi output="${1}__not_in__${2}" comm -23 <(sort "${1}") <(sort "${2}") > "${output}" printf "%s\n" "results of what is in ${1} and not in ${2} in ${output}"