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
how to identified this iostat value adzuanamir AIX 2 04-30-2009 01:57 AM
Equivalent for iostat -e in AIX HP-UX Linux prasi_in UNIX for Advanced & Expert Users 1 02-06-2008 10:38 AM
Help wantyed to understand iostat -D in AIX 5.3 Harpo_HK UNIX for Dummies Questions & Answers 2 08-21-2007 12:23 PM
Help with iostat ... dj_is Filesystems, Disks and Memory 3 08-12-2007 01:09 PM
iostat output what is that mean foongkt5220 UNIX for Advanced & Expert Users 2 08-29-2006 03:49 AM

Closed Thread
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
  #1 (permalink)  
Old 05-06-2009
ilan ilan is offline
Registered User
  
 

Join Date: Jul 2007
Posts: 101
for loop syntax problem in iostat script on solaris

bash-3.00# ./test.sh 100 10
./test.sh: syntax error at line 6: `(' unexpected
bash-3.00# cat test.sh
#!/bin/sh
start=0
end=$1
interval=$2
iostat -xnpr > disk_iostats.csv
for (( start=0; $start<=$end; start=$(($start+$interval)) ))
do
sleep $interval
iostat -xnpr | grep -v device >> disk_iostats.csv
done
bash-3.00#


Hello Experts, i'm stuck with some silly problme here with for, not sure where i'm doing wrong. can somebody point me my mistake in the above script?
:: two arguments i'm taking are end (which tels how many secs to run) and interval (which tells the interval of every run of iostat)


the above script runs fine on linux but not on solaris!?

Thanks for your time.

Last edited by ilan; 05-06-2009 at 12:31 AM..
Closed Thread

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 05:56 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