The UNIX and Linux Forums  

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



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-29-2007
rockysfr rockysfr is offline
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
Remove advertisements
!!
Forum Sponsor