所以我打算在这里做的是从http://tuxonice.net/downloads/all/(目前tuxonice-for-linux-3.8.0-2013-02-24.patch.bz2
)确定TuxOnIce的最新稳定版本。如何确定最新的稳定TuxOnIce版本尽可能紧凑
什么复杂的事情是,有没有“当前”的链接,所以我们得遵循版本,这是一样的东西(这是不存在的):
tuxonice-for-linux-3.8.0-2013-4-2.patch.bz2
tuxonice-for-linux-3.8-4-2013-4-16.patch.bz2
tuxonice-for-linux-3.8-11-2013-5-23.patch.bz2
的问题是他们会是在这个顺序:
tuxonice-for-linux-3.8-11-2013-5-23.patch.bz2
tuxonice-for-linux-3.8-4-2013-4-16.patch.bz2
tuxonice-for-linux-3.8.0-2013-4-2.patch.bz2
我目前的实施(这是垃圾)是这样的。我想过使用时间,但无法弄清楚如何做,要么(/tmp/tuxonice
是索引文件):
_major=3.8 # Auto-generated
_TOI=$(grep ${_major}-1[0-9] /tmp/tuxonice | cut -d '"' -f2 | tail -1)
[ ! $_TOI ] && _TOI=$(grep ${_major}- /tmp/tuxonice | cut -d '"' -f2 | tail -1)
[ ! $_TOI ] && _TOI=$(grep ${_major}.0-2 /tmp/tuxonice | cut -d '"' -f2 | tail -1)
感谢。
不知道你可以按日期排序索引。所以只要不存在任何其他版本的相同内核,简单的'grep $ {_ major}/tmp/tuxonice | cut -d'“'-f2 | head -1'就足够了(之前是'curl -s”http://tuxonice.net/downloads/all/?C=M&O=D“-o/tmp/tuxonice') – Det
确实!如果您好奇,请查看[Apache的mod_autoindex文档](http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#query),了解Apache(Apache)的可能排序和格式参数)index。很明显,只有当它们坚持支持通过URL参数进行排序的web服务器时,它才会起作用(不是很多) –
当然,'grep -m1'甚至比'| head -1'好。现在。 – Det