[email protected] wrote: > I need to sort these files. > > access.log.12 access.log.19 access.log.6 > access.log.13 access.log.2 access.log.7 > access.log access.log.14 access.log.20 access.log.8 > access.log.0 access.log.15 access.log.21 access.log.9 > access.log.1 access.log.16 access.log.3 > access.log.10 access.log.17 access.log.4 > access.log.11 access.log.18 access.log.5 > > Current I have tried using "sort" but they still do not sort correctly > because some of the files do not have a leading zero. > > Is there some other way to sort files without a leading zero? > > > In this case, "sort -n -t . +2" seems to do the trick nicely. -n to > make the sort numeric, and -t . +2 to use period as the field delimiter > and to sort on the second field.
Thank you for replying. On my Gentoo, the script did not work. Sort does not like "+2". Tried using -k option but that too did not give the correct sorting. P.V.Anthony _______________________________________________ Slugnet mailing list [email protected] http://wiki.lugs.org.sg/LugsMailingListFaq http://www.lugs.org.sg/mailman/listinfo/slugnet
