Shell Script Email not working Properly


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell Script Email not working Properly
# 1  
Old 10-13-2009
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.

Code:
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 :

Code:
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?

-KRSmilie

Last edited by vgersh99; 10-13-2009 at 06:09 PM.. Reason: code tags, PLEASE!
# 2  
Old 10-13-2009
Hi.

Try using "set LINESIZE" in your SQL.

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


SQL> set lines 100 
SQL> r
qwertzuiopasdfghjklyxcvbnm

SQL>


Last edited by Scott; 10-13-2009 at 06:17 PM..
# 3  
Old 10-13-2009
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 [code] and [/code] 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
# 4  
Old 10-13-2009
(Post withdrawn)

Last edited by methyl; 10-13-2009 at 06:54 PM..
# 5  
Old 10-13-2009
Shell Script Email not working Properly

I tried the Set Length Option and Still it is not working Properly.
# 6  
Old 10-13-2009
The same problem? More details would be helpful.

Plus, this is wrong:
Code:
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:
Code:
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
`


Last edited by Scott; 10-13-2009 at 08:29 PM..
# 7  
Old 10-13-2009
Is there more than one hit from this SQL statement:
Quote:
SELECT email_ids
i.e. What is in ${MAILLIST} ? One email address or several email addresses?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File count script not working properly

Hi Experts, I have this script to count the number of files based on prefix and suffix values. #!/bin/ksh file_date=$1 prefix=$2 suffix=$3 file_count=$(ls -l /db/day_file/{$prefix}*${file_date}*{$suffix}) The files in the directory /db/day_file are as below. 20170501 20170501... (7 Replies)
Discussion started by: nalu
7 Replies

2. Shell Programming and Scripting

Email forwarding to shell script is not working

Trying to redirect email received to shell script using the following command in the .forward file \vudum001, "| /home/vudum001/kk $1" /home/vudum001 : Home directory kk script file in home directory kk file contents echo $1 >>file1 gave 755 access to .forward as well as script... (1 Reply)
Discussion started by: mvudugula
1 Replies

3. Shell Programming and Scripting

Sed script not working properly on Solaris (works fine on AIX)?

Hi, I have a problem with a SED script that works fine on AIX but does not work properly on a Solaris system. The ksh script executes the SED and puts the output in HTML in tables. But the layout of the output in HTML is not shown correctly(no tables, no color). Can anyone tell if there is... (7 Replies)
Discussion started by: Faith111
7 Replies

4. Shell Programming and Scripting

Moving old files bash script - not working properly

I'm trying to write a script that moves data that's older than 2 weeks to a different place. It works well, EXCEPT, that when the script hits a file within a directory inside the working directory, it will move it to the root of the destination directory instead of putting it in the correct... (1 Reply)
Discussion started by: ugolee
1 Replies

5. Shell Programming and Scripting

Shell script not working properly

Hello, i have below shell script to process ftp get from server and create file list afte finish. this shell scipt has 6 parameter input. unfortunately, it is only working to get the file and terminated before creating file list. please help. thanks, #!/bin/ksh ## example usage :... (3 Replies)
Discussion started by: daryatmo
3 Replies

6. Shell Programming and Scripting

script line not working properly

Hi , I am using the below command in script. $_IDLETIME is returning value if i execute the script manually. sar > $_LOCATION/sar.txt _IDLETIME=`tail -2 $_LOCATION/sar.txt | head -1 | tr -s ' ' ' ' | cut -d ' ' -f8 | cut -d '.' -f1`; if But it s not returning any value if it put the... (3 Replies)
Discussion started by: ahamed
3 Replies

7. UNIX for Dummies Questions & Answers

Issue with shell script: not detecting file properly

The following script is meant to check the presence of a file - called filename0.94.tar.gz - and uncompress it: #!/bin/sh # check presence of file VERSION=0.94 if ; then # file not present: abort echo "Files cannot be found." #exit 1 (commented out this line, so we can see how the... (2 Replies)
Discussion started by: figaro
2 Replies

8. Shell Programming and Scripting

Script not working..."sort" not working properly....

Hello all, I have a file - 12.txt cat 12.txt =============================================== Number of executions = 2 Total execution time (sec.ms) = 0.009883 Number of executions = 8 Total execution time (sec.ms) = 0.001270 Number of... (23 Replies)
Discussion started by: Rahulpict
23 Replies

9. Shell Programming and Scripting

Shell script not processing if statement properly

Hi I am trying to create a shell script that will look for a contracthead file first and if the contract head file does not exist on day1 exit script. Now on day2 if contracthead exists or not run the script uploading files in order such as contract line then contract contact so the... (2 Replies)
Discussion started by: jonathan184
2 Replies

10. Programming

y is this not working properly?

#include <stdio.h> #include <sys/types.h> #include <string.h> #include <sys/stat.h> #include <unistd.h> struct stat s; main() { char c; if (fork()==0) { system("clear"); do { printf("myAI\\>§ "); scanf("%s",c); if(stat(c,&s)>-1) {... (3 Replies)
Discussion started by: C|[anti-trust]
3 Replies
Login or Register to Ask a Question