How to pass a CTRL-D to a command line within a script?
the uuencode is : uuencode name < sourcefile
maybe just need a final empty line : add
; echo -e "\n\n" ;
before the closing parenthesis, and try again?-
So in your case:
( cat bodyText.txt; uuencode backup.tar < backup.tar ; echo -e "\n\n" ; ) | mail -s "backup" [email protected]
Another way is using mutt
which handles attachments better, and knows about mime types, etc:
mutt -s "the subject" -a backup.tar -- [email protected] < bodyText.txt