iankelling.org
/
git
/
tee-unique
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a468c8c
)
fix regression
author
Ian Kelling
<ian@iankelling.org>
Mon, 11 Aug 2014 19:56:03 +0000
(12:56 -0700)
committer
Ian Kelling
<ian@iankelling.org>
Mon, 11 Aug 2014 19:56:03 +0000
(12:56 -0700)
teeu
patch
|
blob
|
history
teeu-function
patch
|
blob
|
history
diff --git
a/teeu
b/teeu
index 9ff55ceba8efd696e1c20b3ca5b99be8afd1a35d..9a7345bf027b94a069a251296b4bc8d97fb91e4f 100755
(executable)
--- 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 e4705b7afd3e07a3803602cdd9aad9deec0295e1..735cd3fc9d1fda987b2578fe2cf6a149887f4bfc 100644
(file)
--- 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