#!/bin/bash -l x=$(mktemp) appendu $x<<'EOF' abc *!@#$^&*))0_)()?>> $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"; }