Shell Script Email not working Properly

Hi GURU's,

I'm using a Shell Script to send email's as an attachment.
I'm Storing the email address in a table and catching in a variable.

MAILLIST=`noarg sqlplus -s $OraUsr << EOF
	set heading off
	set feedback off
	set echo off
	SELECT email_ids
	FROM tpemail_table 
	WHERE ltrim(rtrim(interface_name)) = '$INT_CODE'
        AND instance = '$TWO_TASK';
	quit;
	EOF`

When I echo the email list.
Echo Mailing List - $MAILLIST
I see the email is broken at every 80 Character.

So the first 80 characters email ids are receiving the emails, but the rest are ignored.

The mailx command used is :

fi
echo $v_out
echo   "( ${v_log}; ${v_out} )|mailx -m -s \"Notification - $INTERFACE_NAME ($DB_INSTANCE)\" $MAILLIST"

   ( ${v_log}; ${v_out} )|mailx -m -s "Notification - $INTERFACE_NAME ($DB_INSTANCE)" $MAILLIST
fi

Could you please help me to identify the issue?

-KR:confused:

Hi.

Try using "set LINESIZE" in your SQL.

SQL> set lines 20
SQL> select 'qwertzuiopasdfghjklyxcvbnm' from dual;
qwertzuiopasdfghjkly
xcvbnm


SQL> set lines 100 
SQL> r
qwertzuiopasdfghjklyxcvbnm

SQL> 

To keep the forums high quality for all users, please take the time to format your posts correctly.

First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags

```text
 and 
```

by hand.)

Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.

Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.

Thank You.

The UNIX and Linux Forums

(Post withdrawn)

I tried the Set Length Option and Still it is not working Properly.

The same problem? More details would be helpful.

Plus, this is wrong:

MAILLIST=`noarg sqlplus -s $OraUsr << EOF
	set heading off
	set feedback off
	set echo off
	SELECT email_ids
	FROM tpemail_table 
	WHERE ltrim(rtrim(interface_name)) = '$INT_CODE'
        AND instance = '$TWO_TASK';
	quit;
	EOF`

Should be:

MAILLIST=`noarg sqlplus -s $OraUsr << EOF
	set heading off
	set feedback off
	set echo off
	SELECT email_ids
	FROM tpemail_table 
	WHERE ltrim(rtrim(interface_name)) = '$INT_CODE'
        AND instance = '$TWO_TASK';
	quit;
EOF
`

Is there more than one hit from this SQL statement:

i.e. What is in ${MAILLIST} ? One email address or several email addresses?

The Mail List variable has 25 different email ids.

---------- Post updated at 06:54 PM ---------- Previous update was at 06:53 PM ----------

It has 25 individual email ids

Was this 25 hits from:

or does the database field "email_ids" contain a list of 25 email addresses?

Do you intend to invoke "mailx" once for each email address , or once for all 25 addresses?

There is much variation in "mailx", the maximum size of an environment variable, and the length of a command line. What Operating System do you have? What shell are you using?

Hi,

Thank you for the reply.

Yes, the field Email_id contains all the 25 email ids.
and the mailx is used for all the email_ids in the variable $MAILLIST.

echo "( ${v_log}; ${v_out} )|mailx -m -s \"Notification - $INTERFACE_NAME ($DB_INSTANCE)\" $MAILLIST"

( ${v_log}; ${v_out} )|mailx -m -s "Notification - $INTERFACE_NAME ($DB_INSTANCE)" $MAILLIST
fi