Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh bug report -



Hi

I think I may have found a bug. I posted <http://stackoverflow.com/questions/29073706/zsh-tail-function-not-displaying-correct-file> the problem on stack overflow as I thought it was my lack of understanding. Here is a copy of my post:

If I list the directory contents in most recent modified order and get the most recent file with: 
print dir/*(om[1])
I get the most recently modified file. However, if I just want the file name by using the :t modifier like: 
print dir/*(om[1]:t)
it returns the oldest modified file's file name. My understanding was that the modifier :t is the last action on the returned results and, therefore, it should return the file name of the most recently modified file. Does anyone know why I am getting this unexpected result and how to fix it?

Many Thanks

Paul

zsh <http://stackoverflow.com/questions/tagged/zsh>This behavior seems to be the case with all modifiers (a, e, l, etc.) not just t. The ordering seems to be consistent between different modifiers, but differs when there is a path component in the pattern: print *(om) produces a list ordered by date as expected as does print ./*(om). print *(om:t)*seems to be arbitrarily ordered, print ./*(om:t) seems to alphabetical. most curiously, with print */*(om:t) the returned list is ordered first by the modification date of the first matched glob and but then arbitrarily by the second glob. I suspect that this may be a bug in zsh. –  Adaephon <http://stackoverflow.com/users/2992551/adaephon> Mar 17 at 6:52 <http://stackoverflow.com/questions/29073706/zsh-tail-function-not-displaying-correct-file#comment46417465_29073706>


Please could you let me know if this is actually a bug or is it my lack of understanding in using zsh?

Many Thanks

Paul



Messages sorted by: Reverse Date, Date, Thread, Author