Try changing the following:
>##########################################################
>grep -n 'MC Step (' $LOG_INPUT_FILE > $MCSTEP_GREP_OUTPUT
>grep -n 'Actual acceptance ratio =' $LOG_INPUT_FILE \
> > $RATIO_GREP_OUTPUT
>##########################################################
to
(grep -n 'MC Step (' $LOG_INPUT_FILE ; grep -n 'Actual acceptance ratio ='
$LOG_INPUT_FILE) |
mailx -s 'SUBJECT of your choice' EMAIL_ADDRESS
It takes the first part and prints it to STDOUT then
immediately does the second part and print it STDOUT then
takes both parts (from STDOUT - now STDIN) and sends it
to the mailx command to email out.
If you want this as an attached file
place | uuencode OUT_FILE_NAME prior to the mailx command
George
>-----Original Message-----
>From: Dow Hurst [mailto:">dhurst@kennesaw.edu]
>Sent: Tuesday, March 28, 2000 10:02 AM
>To: ">ale@ale.org
>Subject: [ale] OT:Shell script question
>
>
>What would be a way, using shell scripting, to take one line from two
>separate text files, append them into one line, and output that
>resulting line to another file? In the following script, I started to
>"cat" them together, then "sort" them using the line number from the
>"grep" command, however, I thought that it would be easier to read if
>I could join the two pieces of data into one line. I just don't know
>how to do that. I don't know any programming languages yet and have
>only delved into shell scripts at this point. Thanks for your help,
>Dow
>
>Here is my starting point:
>##########################################################
>#!/bin/sh
>#
># Checks acceptance ratio and emails to address specified
># in the command line.
>#
># Example:
>#
># Aslan 1% ./accept.ratio.sh ">email@dot.com ./confmem.log &
>#
># The above example would look in the specified log file
># and email output to specified address
>#
># Created by Dow Hurst Thu Mar 23 11:52:44 EST 2000
>##########################################################
>#Variables################################################
>LOG_INPUT_FILE=$2
>EMAIL_ADDRESS=$1
>MCSTEP_GREP_OUTPUT=mcstep.grep.txt
>RATIO_GREP_OUTPUT=ratio.grep.txt
>##########################################################
>grep -n 'MC Step (' $LOG_INPUT_FILE > $MCSTEP_GREP_OUTPUT
>grep -n 'Actual acceptance ratio =' $LOG_INPUT_FILE \
> > $RATIO_GREP_OUTPUT
>##########################################################
>
>--
>__________________________________________________________
>Dow Hurst Office: 770-499-3428
>Systems Support Specialist Fax: 770-423-6744
>1000 Chastain Rd.
>Chemistry Department SC428 Email:">dhurst@kennesaw.edu
>Kennesaw State University ">Dow.Hurst@mindspring.com
>Kennesaw, GA 30144
>*********************************
>*Computational Chemistry is fun!*
>*********************************
>--
>To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale"
>in message body.
>
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.