I would like to write on local file (or local variable if better) and set its content to a variable within a ssh command substitution. Here is my code :REMOTE_OUTPUT=$(ssh remote@server /bin/bash << 'EOF'    find //opt/autosys113/autouser.PI3/out/ -not -path opt/autosys113/autouser.PI3/out/*/ -type f -daystart -ctime 10 | while read filename; do        tac $filename | sed -n '/----------------------------------------/,$p; /PROBLEM/q' | sed 's/.*PROBLEM//; s/----------------------------------------.*//' | tac > mcaj-temp        if grep ] ERROR  mcaj-temp; then            filenamebase=$(basename $filename)            echo -e \n----------------------------------------------------------\n\n$filenamebase failure:            < mcaj-temp        fi    done    rm mcaj-tempEOF)But the file is not even created. Otherwise the find loop and if grep statement have been tested and are correct.Thanks in advance
How to write into local file and set its content to a variable within a ssh command substitution
shell;files;sed;command substitution