perl - How can I check if the Mac OS is in 32 bit or 64 bit? -
i want determine if mac os in 32 bit or 64 bit.
who can write down perl script me?
you can check output of uname -a , see if says i386 or x86_64 on end:
#! /usr/bin/env perl use strict; use warnings; use feature qw(say); no warnings qw(uninitialized); if (not -x "/usr/bin/uname") { "can't determine system bit mode: uname command not found"; } else { chomp ( $arch_type = qx(/usr/bin/uname -a) ); if (not $arch_type) { "can't determine system bit mode"; } elsif ($arch_type =~ /x86_64$/) { "system in 64 bit mode"; } else { "system in 32 bit mode: $arch_type"; } }
Comments
Post a Comment