The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Mailx : can we have the body to be a binary file ? CKIRCH UNIX for Dummies Questions & Answers 5 01-01-2008 03:33 PM
concatenating strings.. jt_csv Shell Programming and Scripting 2 02-07-2007 06:09 PM
MAILX Body containing SQL results dstinsman UNIX for Dummies Questions & Answers 2 10-05-2006 08:12 PM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 06:27 AM
Concatenating Strings radhika03 Shell Programming and Scripting 2 09-08-2005 11:48 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-29-2007
Registered User
 

Join Date: Jun 2007
Posts: 24
mailx: concatenating strings for message body (KSH)

Hi all,

Think this is a pretty simple problem, but I've been thinking about it for a few days. Let's say that I'm going to have to output the contents of a file as the body of a mailx message.

I'll probably do this: cat <filename> | mailx <extra commands>

However, how do I go about doing it if I need to append some compulsory messages as the headers and footers of the message body? Can this be achieved without the creation of another file or appending lines to the file being referenced (assume that I have no privileges to write to or create files)

(ie. the mail body should look like this)

Welcome user. This is the printout of your status file.
OUTPUT OF cat <filename>
Please contact XYZ for any unresolved queries.

Thanks in advance.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-29-2007
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,356
{ echo "line one" ; cat data ; echo "last line" ; } | mailx
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 07:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0