Unix Mailx command not working

Discussion in 'all things UNIX' started by LokM, Feb 17, 2016.

  1. LokM

    LokM Registered Member

    Joined:
    Feb 17, 2016
    Posts:
    2
    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+C to exit the script.

    mailx -s "INVENTORY DATALOAD for ${DATALOAD_DAYSTAMP} " ${EMAIL_LIST}

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

    Please help me understand the issue here and suggest.
     
    Last edited: Feb 17, 2016
  2. LokM

    LokM Registered Member

    Joined:
    Feb 17, 2016
    Posts:
    2
    i found the issue the command was missing the attachment name in the uuencode section.

    Thank you
     
Loading...