iankelling.org
/
git
/
tee-unique
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
minor perf idiom improvement
[tee-unique]
/
appendu-function
diff --git
a/appendu-function
b/appendu-function
index 40a4edfa4d6ef92c33530c77cd643461ffb06ed6..a169bd7cf680a860116d46928b442b9583baaadb 100644
(file)
--- a/
appendu-function
+++ b/
appendu-function
@@
-56,7
+56,7
@@
Appended lines are output to the terminal.
readsudo=
writesudo=
fi
- if
[[ $@ ]]
; then
+ if
(( $# ))
; then
for x in "$@"; do
[[ -e "$file" ]] && $readsudo grep -q "^$x$" "$file" || $writesudo tee -a "$file"<<<"$x"
done