0

I am trying to send an attachment via a script and the logic works if i run manually but not as part of the script. if I add echo, the email goes out and populates with uuencode jef20.txt jef20.txt but no attachment. any ideas?

#!/bin/bash
echo Your Username?
read user
echo FIX Session?
read session
echo what client?
read client
awk '!/35=0|35=A|35=5|35=2|35=1|closed/'  /company/gate/app_phoenix/logs/fix/$session >> /home/dnash/$client.txt
uuencode $client.txt $client.txt | mailx -s "Cert Logs" "$user@company.com"
dnash
  • 1
  • 1

1 Answers1

0

Depending on your version of mailx , you can use the -a ( "attach" ) command line switch:

mailx -a "$client.txt" -s "Cert Logs" "$user@company.com"

See Also

mailx manpage

how to send an email via mailx with enclosed file

Corion
  • 3,855
  • 1
  • 17
  • 27