Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Unix Mailx command not working

Unix Mailx command not working

Unix Mailx command not working

Hi All,

i'm trying to create a shell script which will perform a dataload and sends out the mail in case the status ends with an error. i'm using Notepad++ to create this shell script and using .sh file extension.

i'm using the following statement is used to send the email.
uuencode ${COMMERCE_FOLDER}/logs/wc-dataload.log | mailx -s "INVENTORY DATALOAD for ${DATALOAD_DAYSTAMP} " ${EMAIL_LIST}

the script does not finish executing itself and waiting this line forever. However when i do CTRL+C the program exits and the mail is received. Also the attachment never gets attached to the mail. i tried just using the mail alone without any attachment like below still same issue and needs CTRL+X to exit the script.


Also note that i tried with only the email statement in the entire shell script but still same result.

Please help understand the issue here and suggest.

RE: Unix Mailx command not working

you can try the -v option and maybe you can see what's going on (or not going on)

adaptive uber info galaxies (bigger, better, faster, and more adept than cognitive innovative agile big data clouds)

RE: Unix Mailx command not working

The command "uuencode" is your hangup. If you only give it one parameter, you need to pipt your file to it. Or you can give it two parameters. First parameter will be the file it encodes, second parameter will be the name it gives the attachment. So this should do it...


uuencode ${COMMERCE_FOLDER}/logs/wc-dataload.log wc-dataload.log | mailx -s "INVENTORY DATALOAD for ${DATALOAD_DAYSTAMP} " ${EMAIL_LIST} 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close