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 and shell scripting languages 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 07:33 PM
concatenating strings.. jt_csv Shell Programming and Scripting 2 02-07-2007 10:09 PM
MAILX Body containing SQL results dstinsman UNIX for Dummies Questions & Answers 2 10-06-2006 12:12 AM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 10:27 AM
Concatenating Strings radhika03 Shell Programming and Scripting 2 09-09-2005 03:48 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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.
  #2 (permalink)  
Old 07-29-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,131
{ echo "line one" ; cat data ; echo "last line" ; } | mailx
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0