I always use awk for this kind of thing, with a bash "wrapper" (usually 
piping the output of "ls" into the awk program). If you are interested 
I'll dig around and find something similar to this in my ~/bin directory.

Jim Hartley

John Mort wrote:
> I have a crontab script that pulls map files (a PNG) from an online
> game once a day, and stores them in a folder named after the date.
> Games are numbered from 33 to 70, in this way I can have a time stamp
> on the state of each game every day.
> 
> I've been collecting this for several months, and would like to turn
> these collections of pictures into movies to post on the forums, so
> that people can see how each game has flowed over time.  On my own
> I've figured out how to write a script to make a new folder for each
> game, then copy map files for each day into it's respective folder,
> renaming them to the date they were taken.
> 
> I was planning on using mencoder to try to make them into a movie, but
> the mencoder documentation says the pictures need to be in numerical
> order.  I altered the script to rename it this way by using cp
> $sourcefile /$game/day$i.png, where $i is incremented, resulting in
> the files being called day1.png, day2.png, day3.png, etc.
> 
> I was wondering if there was a way to do this so that it would instead
> call them day001.png, day002.png, day003.png, etc?  I don't know yet
> if mencoder is going to count "1, 10, 11, 12, ... , 19, 2, 20, 21,
> ..." or not, but I know that sometimes it's useful to have things
> spaced out this way and I'd like to know how to do it, just haven't
> found anything that tells me how to do it in bash yet.  Any
> suggestions?
> 

-- 
Teen Angel - a ghost story - http://teenangel.netfirms.com
_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org          
   
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug                           
Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium          
                              
  Dec 5 - Open Source Show and Tell
  Jan 2 - TBD
  Feb 6 - DBUS
  Mar 5 - Setting up a platform-independent home/small office network using 
Linux

Reply via email to