Sponsored Content
Full Discussion: Better way to do this?
Top Forums Shell Programming and Scripting Better way to do this? Post 302405537 by hj007 on Friday 19th of March 2010 05:28:44 AM
Old 03-19-2010
Better way to do this?

Hi Experts,

After the great suggestions I received yesterday, i'm back again, asking for more Smilie.
I have close to 8-10 lines of code performing an operation, id like to know, if there is a more compact way to do this.

# Removes the first line which is a message
Code:
awk 'match($0,"The following message") == 0 {print $0}' results_Linux.out > tmp
mv tmp results_Linux.out

# Removes the empty lines in the file
Code:
cat results_Linux.out | awk '$0!~/^$/ {print $0}' > tmp
mv tmp results_Linux.out

# Removes the last part of each line and adds a URL to the end
Code:
sed -e 's|WAITING (Being queued on farm)|http://dte/dte30/faces/monitorPage/jobId=|' results_Linux.out > tmp
mv tmp results_Linux.out

# Adds the first word of each line to the end of the line as well
Code:
awk '{print $0$1}' results_Linux.out > tmp
mv tmp results_Linux.out

# Send a mail to the user
Code:
userID=`whoami`
datetime=`date`
cat results_Linux.out | mail -s "Linux Run Results for - [$userID] executed on - [$datetime]"  $EMAIL

 
platform::shell(n)					       Tcl Bundled Packages						platform::shell(n)

__________________________________________________________________________________________________________________________________________________

NAME
platform::shell - System identification support code and utilities SYNOPSIS
package require platform::shell ?1.1.4? platform::shell::generic shell platform::shell::identify shell platform::shell::platform shell _________________________________________________________________ DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell. This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only requirement is that the other shell (identified by its path), is actually executable on the current machine. While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run 32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers. For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed packages, versus the architecture of the shell running the repository software. COMMANDS
platform::shell::identify shell This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell. platform::shell::generic shell This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell. platform::shell::platform shell This command returns the contents of tcl_platform(platform) for the specified Tcl shell. KEYWORDS
operating system, cpu architecture, platform, architecture platform::shell 1.1.4 platform::shell(n)
All times are GMT -4. The time now is 11:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy