sh文件示例如下:文章来源:https://www.toymoban.com/news/detail-426266.html
#!/bin/sh
SCRIPTDIR="$( cd "$( dirname "$0" )" && pwd )"
dlldir=$SCRIPTDIR
cd `dirname $0`
get_arch=`arch`
dotnetName="dotnet"
if [[ $get_arch =~ "x86_64" ]];then
echo "this is x86_64"
if [ ! -f dotnet ];then
tar xvf aspnetcore-runtime-3.1.30-linux-x64.tar.gz
fi
dotnetName="./dotnet"
elif [[ $get_arch =~ "aarch64" ]];then
echo "this is arm64"
elif [[ $get_arch =~ "mips64" ]];then
echo "this is mips64"
else
echo "unknown!!"
fi文章来源地址https://www.toymoban.com/news/detail-426266.html
到了这里,关于Linux使用shell脚本判断cpu架构的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!