Clever bash hack Posted on April 20, 2012August 10, 2025 by Christopher I stubled across this from a colleague at my new gig: #!/bin/bash if uname -r | { IFS=.- read -r a b c _; [ "$((a*10000+b*100+c))" -lt 20622 ]; }; then echo 'Your kernel is too old!'; else echo 'Your kernel is 2.6.22 or newer!' fi Share this: Share on Facebook (Opens in new window) Facebook Share on Threads (Opens in new window) Threads Share on Bluesky (Opens in new window) Bluesky Share on WhatsApp (Opens in new window) WhatsApp Like this:Like Loading…