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
Formula help bobo UNIX for Dummies Questions & Answers 8 03-29-2008 02:53 AM
Abacus Formula Compiler 1.0.1 (Default branch) iBot Software Releases - RSS News 0 03-09-2008 06:20 AM
formula to get the swap space on a machine melanie_pfefer SUN Solaris 1 03-03-2008 03:15 PM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 04:06 AM
Quadratic Formula Program zeek UNIX for Advanced & Expert Users 2 02-22-2002 11:32 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-15-2007
scottzx7rr scottzx7rr is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 17
Help with formula in a script

I need some help. I been doing system admin for the last several years and gotten very rusty on scripting. I need to write a script that will take a log entry and do math using two columns of data to create a new column. I am taking the column(#2) that contains the time and the column(#5) that contains transaction milliseconds and subracting that column for the time column to create a new column in the file. I am butting my head against my screen trying to remember who to do it. Here is an example of my log entry.

20070401 004639826 decode 10578 2770 2.77 00:46:37 29.728125 10.732
17509

So to make it easier to understand if I didn't above(up for about 20 hours working on a project so I might be a little fuzzy, LOL)
I want something that does this:
004639826 - 2770 = 004637056
And overwrites the 004637056 to column 8 to have the following output:
20070401 004639826 decode 10578 2770 2.77 004637056 29.728125 10.732
17509


I much appreciate any help that you can provide.


Thanks in Advance.

Scott

Last edited by scottzx7rr; 08-15-2007 at 03:49 AM..
 

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 02:16 PM.


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