开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜