I tried to use the read/write file descriptor in bash so that I could delete the file that the file descriptor referred to afterward, as such:
F=$(mktemp) ex
Try changing the sequence of commands:
F=$(mktemp tmp.XXXXXX) exec 3<> "$F" echo "Hello world" > "$F" rm -f "$F" #echo "Hello world" >&3 cat <&3