Sponsored Content
Full Discussion: Better way to do this?
Top Forums Shell Programming and Scripting Better way to do this? Post 302405540 by vino on Friday 19th of March 2010 05:38:56 AM
Old 03-19-2010
You could drop the multiple mv commands. Do it as

Code:
awk 'match($0,"The following message") == 0 {print $0}' results_Linux.out > tmp

awk '$0!~/^$/ {print $0}' tmp > results_Linux.out

sed -e 's|WAITING (Being queued on farm)|http://dte/dte30/faces/monitorPage/jobId=|' results_Linux.out > tmp

awk '{print $0$1}' tmp > results_Linux.out 

userID=`whoami`
datetime=`date`
cat results_Linux.out | mail -s "Linux Run Results for - [$userID] executed on - [$datetime]"  $EMAIL

I think it may be possible to combine the multiple awk's into a single awk command. Or even perhaps the whole thing can be done in perl.
 
YESTERDAY(1)						      General Commands Manual						      YESTERDAY(1)

NAME
yesterday - print file names from the dump SYNOPSIS
yesterday [ -c ] [ -date ] files ... DESCRIPTION
Yesterday prints the names of the files from the most recent dump. Since dumps are done early in the morning, yesterday's files are really in today's dump. For example, if today is March 17, 1992, yesterday /adm/users prints /n/dump/1992/0317/adm/users In fact, the implementation is to select the most recent dump in the current year, so the dump selected may not be from today. With option -c, yesterday copies the dump file to the current directory. The date option selects other day's dumps, with a format of 2, 4, 6, or 8 digits of the form dd, mmdd, yymmdd, or yyyymmdd. Yesterday does not guarantee that the string it prints represents an existing file. EXAMPLES
Back up to yesterday's MIPS binary of vc: cd /mips/bin yesterday -c vc Temporarily back up to March 1's MIPS C library to see if a program runs correctly when loaded with it: bind `{yesterday -0301 /mips/lib/libc.a} /mips/lib/libc.a rm v.out mk v.out FILES
/n/dump SOURCE
/rc/bin/yesterday SEE ALSO
fs(4) BUGS
It's hard to use this command without singing. YESTERDAY(1)
All times are GMT -4. The time now is 04:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy