Created
September 14, 2012 17:59
-
-
Save alexander-potemkin/558e71744225704e0b6b to your computer and use it in GitHub Desktop.
perl detect arch
This file contains 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
#!/usr/bin/perl -w | |
use strict; | |
chomp(my $arch = `uname -m`); | |
if ($arch eq 'x86_64') { | |
print "64 bit here\n"; | |
} elsif ($arch eq 'i386') { | |
print "32 bit here\n"; | |
} else { | |
print "Sorry, I'm lost with '$arch' architecture." | |
} | |
print "$arch\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment