I have a python script which prints some data and also writes data to a file as well.
I wanted to mail both the stuff from the linux terminal.
I am using the below command.
python script.py | mail -s "subject" -a filename.txt email@example.com
Don't pipe the Python script to
cat that temporary file piping it to the
python script.py > temp-file.out cat temp-file.out | mail -s "subject" -a filename.txt firstname.lastname@example.org