Last active
August 29, 2015 14:14
-
-
Save Tomin1/1c7cb530413a56959508 to your computer and use it in GitHub Desktop.
kernels.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This script is made by Tomi Leppänen aka Tomin (http://tomin.dy.fi/) | |
| # You are free to use, copy, redistribute and modify this script | |
| # as long as you accept that ***I won't take any responsibility | |
| # for this code and it comes without any warranty*** | |
| # This script downloads Kernel.org webpage and prints out a table | |
| # of latest Linux releases | |
| KERNEL_ORG=www.kernel.org | |
| kernels=$(wget -O - $KERNEL_ORG 2> /dev/null |\ | |
| grep -A 2 -E '(mainline|stable|longterm|linux-next):' |\ | |
| sed -re 's%</?\w+>%%g' -e 's/[ \t]//g' \ | |
| -e 's/<spanclass="eolkernel"title="ThisreleaseisEnd-of-Life">/ /' |\ | |
| tr '\n' '\t' |\ | |
| sed -re 's/\t*--\t*/\n/g' ) | |
| echo -e "\033[1mtree\tversion\trelease date\033[0m\n$kernels" |\ | |
| awk -F "\t" '{ printf("%-12s\t%-8s\t%-10s\n", $1, $2, $3) }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment