I am using below command and it works:
uuencode stats.txt stats.txt | mailx -s "users" info@whale.de
But when I put same command inside my shell script, it does not work.
I dont have email. I am using ksh
. Can anyone tell me why it fails?
Solution: There was no error and no email sent either. When I used set -x for debug nothing was returned either for debug.
I moved the uuencode section out the function section in the script to a separate section. And it worked; the debug returned message and I got email
set -x
in the first line of your script to help with debugging. – markgraf Feb 02 '23 at 10:25uuencode
myself in years gone by (doesn't that make me feel old!) I can't see anything wrong with the single line snippet posted here. We'd need to see permissions onstats.txt
and have an explanation of "it does not work" - for example, doesuuencode
not produce output, or does themailx
generate an error, or ...? – Chris Davies Feb 03 '23 at 11:02