Need help in an issue related to mailx


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need help in an issue related to mailx
# 1  
Old 09-09-2015
RedHat Need help in an issue related to mailx

Hello,

I have a file temp.txt with the below contents :

Code:
Sep  9 03:04:51 adcsdp01 MAPDR2_00[60716]: Unable to open trace file adpstartarv.log. (Error 110 Resource temporarily unavailable) [ntservsserver.cpp 6754]
Sep  9 03:05:35 adcsdp01 MAPDR2_00[76986]: SAP Service ADPMR2_00 successfully started.
Sep  9 03:04:51 adcsdp01 MAPDR2_00[34879]: Unable to open trace file adpstartarv.log. (Error 19 Resource temporarily unavailable) [gtaserver.cpp 6754]

When I am trying to send the above file using mailx from Red Hat Server , I am getting file on my mailbox with incorrect layout i.e second line is starting in continuation with the very first line although the file has three separate lines

Below is the mailx command :

mailx -s "Sending mail" mailid < temp.txt

Below is the output which shows that second line didnt started in a new line :

Code:
Sep  9 03:04:51 adcsdp01 MAPDR2_00[60716]: Unable to open trace file adpstartarv.log. (Error 110 Resource temporarily unavailable) [ntservsserver.cpp 6754] Sep  9 03:05:35 adcsdp01 MAPDR2_00[76986]: SAP Service ADPMR2_00 successfully started.
Sep  9 03:04:51 adcsdp01 MAPDR2_00[34879]: Unable to open trace file adpstartarv.log. (Error 19 Resource temporarily unavailable) [gtaserver.cpp 6754]

Could someone Please help.

Thanks
Rahul
# 2  
Old 09-09-2015
Hello Rahul,

Could you please check once in your file if there are any ^M characters present by command cat -v Input_file. If yes then you can remove them by tr -d '\r' < Input_file > output_file.

Thanks,
R. Singh
This User Gave Thanks to RavinderSingh13 For This Post:
# 3  
Old 09-09-2015
Hello Ravinder,

Good Evening,

There is no
Code:
^M

character in the above file as seen from the
Code:
cat -v filename

command on the file.
# 4  
Old 09-09-2015
Please post the output of cat -vet filename.
This User Gave Thanks to RudiC For This Post:
# 5  
Old 09-10-2015
try this
Code:
awk '1' ORS='\r\n' | mailx -s "Sending mail" mailed

code error in the above.
Code:
awk '1' ORS='\r\n' temp.txt | mailx -s "Sending mail" mailed


Last edited by SriniShoo; 09-11-2015 at 02:42 AM..
This User Gave Thanks to SriniShoo For This Post:
# 6  
Old 09-10-2015
Thanks. I will Check and reply.
# 7  
Old 09-10-2015
Note that Microsoft Outlook/Exchange arbitrarily re-arranges (join and split) the lines in the mail body.
The only work-around that I know is to tar/zip the text and use an attachment.
This User Gave Thanks to MadeInGermany For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

IHS connector related loading issue

I am getting the following error on loading the connector DLL in IHS 8.5 on AIX 7.1 bash-4.2# /usr/32bit/IBM/HTTPServer/bin/apachectl start httpd: Syntax error on line 902 of /usr/32bit/IBM/HTTPServer/conf/httpd.conf: Cannot load /usr/<company_name>/IHS85/lib/libApache22Connector.a into... (3 Replies)
Discussion started by: George47
3 Replies

2. UNIX for Advanced & Expert Users

Unix terminal display related issue

Want few input related to unix environment and terminal settings: 1. Am trying to find a way to keep the unix terminal display intact even after opening and closing a vi/less file. Currently if I open a vim file in the unix terminal and then close the file,it displays the contents of vim file on... (4 Replies)
Discussion started by: talktovkjain
4 Replies

3. Shell Programming and Scripting

Error related to mailx function

Hi All, I have used the following syntax for sending email. "mailx -s "process not running" userid@domain.com " I am getting below error. " mailx: not found " Can anoy one please give the reason for this error. I am using REDHAT server. (2 Replies)
Discussion started by: suresh.gunti
2 Replies

4. Shell Programming and Scripting

Date related issue

Hi, I have TDATE=$(date '+%b %d') That stores "Sep 01" in the TDATE. How I can store "Sep 1"? Thanks in advance (3 Replies)
Discussion started by: dipeshvshah
3 Replies

5. Programming

Issue Related to Splash Screen in Java

Hi all, Actually I want to flash the image which I have in my system and when I am trying to do it,it is not showing it.simply creates the frame but not displaying the image.I am attaching the code-- Please take a look on it and please provide your valuable suggestions on it so that I... (2 Replies)
Discussion started by: smartgupta
2 Replies

6. Programming

Issue Related to Proxy Server

Hi All, I am establishing the proxy server to communicate the date between devices using serial port but after serial port connection,it should start the Proxy Server and still run till the communication is happening...but server became started but it became halted due to error - Please... (1 Reply)
Discussion started by: smartgupta
1 Replies

7. Programming

Issue Related to Splash Screen

Hi Guys, I am working with Solaris 9 and we are developing the application which will work on different OS.So we develop the GUI using JAVA swings... we want to display a Splash screen before starting the installation of the application... 1st we develop our application for windows and it is... (1 Reply)
Discussion started by: smartgupta
1 Replies

8. Programming

Issue related to native method

Hi, I am working with java and C/C++.In my java code I am using the native method to work with C/C++.So I am getting some error in C/C++ source code which I am not able to find it because It is throwing the only java null Exception.... Is there any way by which I can see the error in java console... (0 Replies)
Discussion started by: smartgupta
0 Replies

9. HP-UX

Facing an issue related to cronjob

Dear All, I am facing an issue related to cronjob and explained below is the case study: 1. I have a java class named "DmCheckRenditionQueue.java" and placed under "/cpc/documentum/product/5.2.5/tomcat/webapps/rendition" 2. When I am using the command "/usr/openv/java/jre/bin/java -cp... (1 Reply)
Discussion started by: parindam
1 Replies

10. Shell Programming and Scripting

file related issue

Hi all, Anybody knows how to write a script to open a file and store the weekday(mon-sun) on first line and current datetime on the second line of the file. If file doesn't exist, create a new one and store the weekday and current datetime. If it already exists, open it and get both... (2 Replies)
Discussion started by: k_oops9
2 Replies
Login or Register to Ask a Question