X-Git-Url: https://iankelling.org/git/?p=tee-unique;a=blobdiff_plain;f=appendu-function;h=a169bd7cf680a860116d46928b442b9583baaadb;hp=40a4edfa4d6ef92c33530c77cd643461ffb06ed6;hb=0a9b2b99289f77d803506dc168b9f69c2c5f7924;hpb=7ca836a05e81aeac0758b10d220e4b618c854ea8 diff --git a/appendu-function b/appendu-function index 40a4edf..a169bd7 100644 --- 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