echo "VIA JOB $1 YOU SENT:" > /ebp/custom.txt if [ -p /dev/stdin ]; then # If we want to read the input line by line while IFS= read line; do echo ${line} >> /ebp/custom.txt done fi echo "*****" >> /ebp/custom.txt