2 # Copyright (C) 2014 Ian Kelling
3 # This program is under GPL v. 3 or later, see <http://www.gnu.org/licenses/>
6 local help="Usage: appendu [-h|--help] FILE [LINE]
8 Tee unique. Append each LINE or if none, each stdin line to FILE if it does not exist in FILE.
10 [-h|--help] display this message"
13 if [[ $1 == --help ||
$1 == -h ]]; then
18 if (( ${#@} == 0 )) ; then
19 echo "teeu error: need 1 or more arguments"
23 local file="$1"; shift
27 for line
in "${@:-$MAPFILE[@]}"; do
28 grep -xFq "$line" "$1" &>/dev
/null ||
tee -a "$1" <<<"$line"