Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
> Need Help With Bash Script, not sure if this is the right place but
Bender
post Oct 7 2004, 12:12 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 4
Joined: 6-July 03
Member No.: 1,056



Hi

I have a directory that contains 100's of files that have similar names, lets say that format of the filename is xxx.yyy.ddd where xxx.yyy are constant and ddd is changing.

I need to delete all but the newest xxx.yyy.ddd file. making sense ?

Lets say I have some files named BAW.N.350, BAW.N.320 and BAW.N.400 where BAW.N.350 is the newest.
How would I go about making a script ( bash, python or something ) for doing that ?
I would have to go through the file listing in the directory and sort together similar filenames and then find out which is newest and delete the others.
I have very little experience with scripting so I'm a little lost sad.gif

Any ideas ?

p.s. as I say dont know if this is the place to ask this but waddaheck tongue.gif
Go to the top of the page
 
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th October 2017 - 09:57 AM