If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Need Help in writing a Shell Script.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-21-05, 06:12
arunprasadlv arunprasadlv is offline
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 41
Need Help in writing a Shell Script.

Hi EveryB
Iam writting a shell script which needs to pick a file (one by one)from the directory and do certain processing on it.
The files in the dir appear in the following format:

-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2501-01050216-.log
-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2501-01050216-.log
-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2501-01050216-.log

-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2503-01050216-.log
-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2503-01050216-.log

-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2505-01050216-.log
-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2505-01050216-.log

-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2507-01050216-.log
-rw-r--r-- 1 arbor arboradm 470714 Feb 16 02:13 TAP2509-01050216-.log

I am getting an error if i try to list the file name which is not present.Is there any possible way to solve this prblm.

eg:
while [ ls -ltr TAP25$count* ]
do

// certain Processing.

count = `expr count + 2`
done

Thanks in Advance,
Arun
Reply With Quote
  #2 (permalink)  
Old 02-21-05, 10:32
ducasio ducasio is offline
Registered User
 
Join Date: Aug 2004
Location: Rome, Italy
Posts: 81
Maybe it is better to use the instruction
for i in TAP25*
do
some work.....
done

bye,
ducasio
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On