tinycm rev 49

blog: sort post correctly (ls is buggy with numbers)
author Christophe Lincoln <pankso@slitaz.org>
date Sun Jan 19 16:16:41 2014 +0100 (2014-01-19)
parents c4a472d0a45e
children 6400421b49c9
files plugins/blog/blog.cgi
line diff
     1.1 --- a/plugins/blog/blog.cgi	Sun Jan 19 15:53:39 2014 +0100
     1.2 +++ b/plugins/blog/blog.cgi	Sun Jan 19 16:16:41 2014 +0100
     1.3 @@ -56,7 +56,7 @@
     1.4  
     1.5  # Display blog post: show_posts count
     1.6  show_posts() {
     1.7 -	for p in $(ls -r $blog | head -n $1)
     1.8 +	for p in $(ls $blog | sort -r -n | head -n $1)
     1.9  	do
    1.10  		show_post ${p}
    1.11  	done