[SGVLUG] shell script & nawk exposure

Emerson, Tom Tom.Emerson at wbconsultant.com
Wed Feb 22 16:25:51 PST 2006


> -----Original Message-----
> Behalf Of Don Gibbs
> 
> Turns out my data files have a time stamp embedded into the name: in 
> this particular case the shell's wildcard expansion is effectively 
> the same as 'ls -t'.  My initial solution had the markings of a 
> ticking time-bomb!

Interesting -- given the discussion, I tried this and saw that "-t" produces the most-recent-file-first -- I can't think of a timestamp format that would naturally sort in that manner (I'm thinking you would get the oldest first)

per the man page, flag "-t" has this entry:

       -t     sort by modification time

which doesn't specify ascending or descending, merely "sorted by time"
 
> Of course, your use of 'head' has negated my need for 'nawk'.  :)  At 
> least for the moment.

which is why my first thought was to use "tail" instead of "head", but essentially the same technique (and then someone started a massive discussion on hybrids that took my attention away from replying...)



More information about the SGVLUG mailing list