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:
7ca836a
)
minor perf idiom improvement
author
Ian Kelling
<ian@iankelling.org>
Wed, 18 Jun 2014 01:53:51 +0000
(18:53 -0700)
committer
Ian Kelling
<ian@iankelling.org>
Wed, 18 Jun 2014 01:53:51 +0000
(18:53 -0700)
appendu
patch
|
blob
|
history
appendu-function
patch
|
blob
|
history
diff --git
a/appendu
b/appendu
index c7455dccdbe43be08e1b5f858f8ef2db7f8f0fcc..1d9388e8840b580327d6ae4bc8ff41ef1344602f 100755
(executable)
--- a/
appendu
+++ b/
appendu
@@
-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
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