0

I have a bash script and I want to be informed when it crashes. I use this:

sendmail [email protected] < customMessage.txt

Howerer, I just want to receive an email saying either "ok" or "error". Is this possible without extra txt file?

sendmail [email protected] < "HI"

does not work

1 Answer 1

2

You could use a here string

sendmail [email protected] <<< "HI"

or a here document

sendmail [email protected] << EOF
Hi
EOF

or just a plain old pipe

echo "Hi" | sendmail [email protected]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .