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
NTFS under Solaris (switching from windows to Solaris server) microbot SUN Solaris 2 07-14-2009 10:46 AM
Now possible to upgrade directly from Solaris 8 SPARC to latest Solaris 10 release iBot Solaris BigAdmin RSS 0 04-21-2009 08:15 PM
Solaris 10 System Administration Essentials (Solaris Series) iBot Solaris BigAdmin RSS 0 01-16-2009 09:30 AM
Solaris Jedi: A quick way to check UDP ports on Solaris iBot Solaris BigAdmin RSS 0 12-03-2008 09:20 AM
Disk Mirror in Solaris 9 via Solaris Volume Manager deal732 SUN Solaris 3 05-02-2007 12:43 PM

 
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 Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-01-2009
achak01 achak01 is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 28
awk in solaris

Friends, I have a awk script which will calculate values for columns which is working fine in linux but failing in solaris.
here is my awk script

iostat -dt $INTERVAL $ITERATION | awk 'NR>4' | egrep -v "Linux|Device|Time|AM|PM|sda[0-9]" | awk '{if(/^$/){printf("%f \n"
,sum); sum=0}else{sum+=$2}}

but a similar thing is failing on solaris

here is the script on solaris

sar -d 2 2 | sed -n '/Average/!p;/Average/q;' | egrep -v "nfs[0-9]|device"|awk 'NR > 2 { if ($1 !~ /,.+/) print }'|

awk ' {if(/^$/){printf("%f \n"
,sum); sum=0}else{sum+=$2}} '
.

Can any one pls clarify why its failing in solaris and whats the remedy
 

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:09 AM.


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