From: Ian Kelling Date: Mon, 11 Aug 2014 19:56:03 +0000 (-0700) Subject: fix regression X-Git-Url: https://iankelling.org/git/?p=tee-unique;a=commitdiff_plain;h=8aa7fedebed4c7b707c0fde9f412235f235efce6;hp=a468c8cdb5a12fce2487ae9816cdb4501ffffa09 fix regression --- diff --git a/teeu b/teeu index 9ff55ce..9a7345b 100755 --- a/teeu +++ b/teeu @@ -21,7 +21,7 @@ Tee unique. Append each LINE or if none, each stdin line to FILE if it does not fi local MAPFILE (( ${#@} >= 2 )) && MAPFILE="${@:2}" || mapfile -t - for line in "${$MAPFILE[@]}"; do + for line in "${MAPFILE[@]}"; do grep -xFq "$line" "$1" &>/dev/null || tee -a "$1" <<<"$line" done return 0 diff --git a/teeu-function b/teeu-function index e4705b7..735cd3f 100644 --- a/teeu-function +++ b/teeu-function @@ -21,7 +21,7 @@ Tee unique. Append each LINE or if none, each stdin line to FILE if it does not fi local MAPFILE (( ${#@} >= 2 )) && MAPFILE="${@:2}" || mapfile -t - for line in "${$MAPFILE[@]}"; do + for line in "${MAPFILE[@]}"; do grep -xFq "$line" "$1" &>/dev/null || tee -a "$1" <<<"$line" done return 0