need a bash script to check its OS version
We have two scripts separately for 64 Bit and 32 Bit.
I need a script to check its OS version and run accordingly.
Any help will be a开发者_JS百科ppreciated.
Cheers, BVN
Like the others have said, you use some command, like uname -m
to find out the OS version, then you use that result to run the appropriate script.
if [ `uname -m` eq 'i686-64' ]; then
exec myscript-64
else
exec myscript-32
fi
Try looking at the output of uname -m
.
精彩评论