you can use this shell script.
#!/bin/bash
echo -n "Running "
RES=`uname -a | grep 64`
if [ $? -eq 0 ]; then
echo -n "64-bit "
else
echo -n "32-bit "
fi
echo -n "operating system on a "
RES=`cat /proc/cpuinfo | grep " lm "`
if [ $? -eq 0 ]; then
echo -n "64-bit "
else
echo -n "32-bit "
fi
echo "machine"
Sample Run:
$ ./os_cpu.sh
Running 64-bit operating system on a 64-bit machine
No comments:
Post a Comment