摘要: 通过对参数扩展的形式直接获取shell脚本路径并进入其中 ##获取当请可执行脚本的名称和路径## $0 ##${变量%/*}通过%参数扩展的方式,删除第一个匹配到的/右方全部内容(*)## ${0%/*} ##进入脚本目录,后获取路径## cd ${0%/*}pwd##最终语句##shellDir= 阅读全文
posted @ 2022-09-22 11:39 猿学习 阅读(1670) 评论(0) 推荐(0) 编辑
摘要: 若未安装wget,安装wget yum install -y wget 获取阿里云镜像repo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 更新镜像源 1 //清除缓存 阅读全文
posted @ 2022-09-18 17:28 猿学习 阅读(523) 评论(0) 推荐(0) 编辑
摘要: Centos7.9 gcc编译器默认版本为4.8.5 ,有时候会需要跟高版本的编译器,例如遇到“Qt requires c++11 support”的问题便需要升级gcc编译器。这里以gcc11为例简单讲述一下升级过程 安装centos-release-scl,出现权限问题使用超级用户(sudo)或 阅读全文
posted @ 2022-07-14 13:41 猿学习 阅读(3025) 评论(0) 推荐(0) 编辑