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
What's wrong with this sed command? delete & append minifish Shell Programming and Scripting 5 04-08-2008 10:34 PM
Append 0 for single digit entered from command line namishtiwari UNIX for Dummies Questions & Answers 2 08-24-2007 06:01 AM
append file with tar command mbakry23 AIX 3 08-07-2007 06:27 PM
How to append "spaces" between strings efernandes UNIX for Dummies Questions & Answers 2 01-23-2007 11:48 PM
Append strings with filler spaces handak9 UNIX for Dummies Questions & Answers 1 08-11-2005 11:51 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-04-2007
rockysfr rockysfr is offline
Registered User
  
 

Join Date: Jun 2007
Posts: 24
Need help with command to append strings

Greetings all,

I'm in need of some help in coming up with this command which requires me to append 5 strings together:

1. echo "Status from system:"
2. `cat logs.txt` (i need the output of this command)
3. echo "Error output: "
4. `cat errors.txt`(i need the output of this command)
5. echo "Thank you"

How can I append all five strings together? I'm interested in doing this and then piping the command over to mailx to construct my message body.

Thanks a bunch.
  #2 (permalink)  
Old 07-04-2007
lorcan lorcan is offline
Registered User
  
 

Join Date: May 2007
Posts: 219
What u can do this to form a temporary file which by appending all the statements from you 5 steps and then include the file as the body of the mailx command.

You can use like

cat letter.dat | mailx ...

Hope this helps
  #3 (permalink)  
Old 07-04-2007
aigles's Avatar
aigles aigles is offline Forum Advisor  
Registered User
  
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,433

Code:
{
   echo "Status from system:"
   cat logs.txt
   echo "Error output: "
   cat errors.txt
   echo "Thank you"
} | mailx ....

  #4 (permalink)  
Old 07-06-2007
bigearsbilly bigearsbilly is offline
Registered User
  
 

Join Date: Feb 2006
Location: Southern England
Posts: 104
or


Code:
mailx -vs "subject" blah@here.com <<EOF
results:
`cat res.ttxt`
errors:
`cat errors.txt`
EOF

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 07:57 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