[PLUG] BASH Script to find last created file in a directory
Will Andrews
Will Andrews <will@physics.purdue.edu>
Mon, 12 Feb 2001 18:51:49 -0500
On Mon, Feb 12, 2001 at 06:24:46PM +0000, Aaron Lehmann wrote:
> I need to find the last created file in a directory for a script I'm
> writng, and then rename it. Can I grep for the last created file, and
> make a variable equal to that name? Is there a better way. Also, I'd
> really like to have an answer in BASH Scripting language. I'm sure that
> PERL would do this better (or that some other thing will be), but I
> don't really want to have to modify the rest of thing to fit.
Please, if you are going to write a shell script, don't use bash as your
reference; use the Real /bin/sh (Bourne). Bourne will suffice for most
tasks; consider also make(1), perl(1), or C (in order of increasing
difficulty and power).
--
wca