Created
December 8, 2015 22:58
-
-
Save forestbaker/e9d9ddb9ad233dae41de to your computer and use it in GitHub Desktop.
Test if the kernel supports 64-bit
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/bash | |
# These commands test if the system is 64-bit. If not, a warning message in red is displayed, if it is 64-bit, x86_64 is displayed | |
[ 64 -eq $(arch | cut -c 5-) ] && arch || echo -e "\e[0;41mTHIS IS NOT A 64-BIT OS\e[0m" | |
[ 64=="$(arch | cut -c 5-)" ] && arch || echo -e "\e[0;41mTHIS IS NOT A 64-BIT OS\e[0m" | |
# Here is a new one, inspired by a post in this thread: | |
# http://unix.stackexchange.com/questions/12453/how-to-determine-linux-kernel-architecture | |
((1<<32)) && arch || echo -e "\e[0;41mTHIS IS NOT A 64-BIT OS\e[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment