The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sed Range Issue Wrathe Shell Programming and Scripting 2 06-17-2008 12:54 PM
dhcpd - range parameter Keene44 IP Networking 1 03-27-2008 10:02 AM
Getting 'out of range' when partitioning pmichner UNIX for Dummies Questions & Answers 1 09-29-2006 10:51 PM
Look a string within a range! azmathshaikh Shell Programming and Scripting 0 05-01-2005 12:54 AM
Unix SCO 5.0.6 Out of range josramon UNIX for Dummies Questions & Answers 5 02-21-2003 11:06 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-19-2007
Registered User
 

Join Date: Feb 2007
Location: india,mumbai
Posts: 82
specifing range....

hi
i want to create file which will be executed in sqlplus
so consider there are abc[1-100] tables and i want count from all the tables now i used for loop for this for eg.
Code:
for name in dayj dptm tfj{1,2,3,4,5,6,7,8} tfx{1,2,3,4,5,6,7,8}
do
    echo "select count(*) from $name;" >> night_file.sql
done
but how can i specify only range like tfj[1-100] ??
Reply With Quote
Forum Sponsor
  #2  
Old 10-19-2007
radoulov's Avatar
addict
 

Join Date: Jan 2007
Location: Milano, Italia/Варна, България
Posts: 1,935
Quote:
Originally Posted by zedex View Post
hi
[..]
but how can i specify only range like tfj[1-100] ??
zsh, bash and ksh93 have brace expansion:

Code:
% printf "select count(1) from tfg%d;\n" {1..10}
select count(1) from tfg1;
select count(1) from tfg2;
select count(1) from tfg3;
select count(1) from tfg4;
select count(1) from tfg5;
select count(1) from tfg6;
select count(1) from tfg7;
select count(1) from tfg8;
select count(1) from tfg9;
select count(1) from tfg10;
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0