--- /dev/null
+#!/bin/bash -l
+x=$(mktemp)
+appendu $x<<'EOF'
+abc
+
+*!@#$^&*))0_)()?><M;sdf234
+
+EOF
+
+y=$(mktemp)
+tee -a $y<<'EOF'
+abc
+
+*!@#$^&*))0_)()?><M;sdf234
+
+EOF
+
+
+output=$(appendu $x<<'EOF'
+foo
+abc
+*(@#$%)
+
+*!@#$^&*))0_)()?><M;sdf234
+EOF
+)
+
+good_output='foo
+*(@#$%)'
+
+[[ $output == "$good_output" ]] || { echo check1 failed; echo "$output != $good_output"; }
+
+echo "$good_output" >> $y
+
+
+diff $x $y || echo check2 failed diffing $x and $y
+
+output=$(appendu $x "abc
+bd" "abc")
+
+good_output="abc
+bd"
+
+[[ $output == $good_output ]] || { echo check3 failed; echo "$output != $good_output"; }
+
+