The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mv command question mjdbouk UNIX for Dummies Questions & Answers 2 06-05-2008 05:40 AM
Question about the PS command Nayas AIX 5 02-22-2008 06:26 AM
cp command Question? deal732 SUN Solaris 1 07-19-2007 07:17 AM
Command Question... DBoy12 UNIX for Dummies Questions & Answers 4 02-16-2007 11:14 AM
question about using tr command merliech UNIX for Dummies Questions & Answers 2 04-24-2006 11:26 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-04-2003
Registered User
 

Join Date: Jul 2003
Posts: 3
Stumble this Post!
question about rm command

i have a lot of messages file in the var directory i want to delete

now i want to keep messages.1 to messages.10 and then delete everything else after 10 which is like 10 to 96

obviously i cant delete these files individual, can someone tell me the command to delete messages.11 to messages.96?

thank you
Forum Sponsor
  #2 (permalink)  
Old 09-04-2003
Registered User
 

Join Date: Aug 2001
Posts: 179
Stumble this Post!
Try this

#!/bin/sh
COUNT=11
while [ $COUNT -le 96 ]
do
rm messages.$COUNT
COUNT=`echo $COUNT+1 |bc`
done
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:16 PM.


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

Content Relevant URLs by vBSEO 3.2.0