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.
 
LR_ENVIRONMENT.IN(1)					  LogReport's Lire Documentation				      LR_ENVIRONMENT.IN(1)

NAME
lr_environment - Export Lire configuration in shell script form SYNOPSIS
eval `lr_environment` DESCRIPTION
The lr_environment command is used to import the Lire configuration in Lire shell scripts. All of Lire configuration variables will be written in a format that can be evaled by the shell. Shell scripts don't usually have to use that command, since it is done by the defaults file sourced by each command. The old names used by when the configuration was done in shell script are also exported by this script for backward compatibility. AUTHOR
Francis J. Lacoste <flacoste@logreport.org> VERSION
$Id: lr_environment.in,v 1.12 2006/07/23 13:16:33 vanbaal Exp $ COPYRIGHT
Copyright (C) 2003 Stichting LogReport Foundation LogReport@LogReport.org This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 LR_ENVIRONMENT.IN(1)
All times are GMT -4. The time now is 09:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy