The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
For Loop with Strings as parameters kadishmj Shell Programming and Scripting 6 10-06-2008 03:57 AM
sed and parameters scotty_123 Shell Programming and Scripting 7 03-26-2007 04:22 AM
Need Parameters Help. james2006 Shell Programming and Scripting 3 06-08-2006 10:46 AM
how to get the similar function in while loop or for loop trynew Shell Programming and Scripting 3 06-17-2002 11:09 AM
tar parameters kmar UNIX for Advanced & Expert Users 4 10-23-2001 03:03 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 03-18-2008
mgirinath mgirinath is offline
Registered User
  
 

Join Date: May 2005
Posts: 69
Parameters in loop

Hi,

I am trying to write a script which will read inputs form user and process those files, I have issue reading the input parameters in a loop. Following is the script...
Code:
I run the script as ./Script.sh 3 table1 table 2 table3

NumberOfTables=$1
let TableCount=1

while [ ${NumberOfTables} -gt 0 ]
do

 TableName='$'$TableCount
 
 db2 "runstats on table ${TableName} and indexes all"

 let  TableCount=TableCount+1
 let  NumberOfTables=NumberOfTables-1

done
exit 0
here I am not able to capture table1 table2 and table3 in the loop it prints TableName as $1 $2 and $3 but not the names that are given as input.

can some one help me on this....
 

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 01:46 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