fix using non-local variable
[tee-unique] / appendu-function
index a169bd7cf680a860116d46928b442b9583baaadb..4c97d7270adbd3f4af06d063682931c88f9309ca 100644 (file)
@@ -36,7 +36,7 @@ Appended lines are output to the terminal.
         return 1
     fi
 
-    local readsudo writesudo
+    local readsudo writesudo x
     local file="$1"
     shift
     
@@ -49,7 +49,7 @@ Appended lines are output to the terminal.
             [[ ! -w $dir ]] && writesudo=sudo
         else
             echo "appendu error: $dir does not exist"
-            exit 1
+            return 1
         fi
     fi
     if ! $dosudo; then