开发者

need a bash script to check its OS version

开发者 https://www.devze.com 2023-03-25 02:50 出处:网络
We have two scripts separately for 64 Bit and 32 Bit. I need a script to check its OS version and run accordingly.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号