Linux shell 编程基础
Linux shell 编程基础
https://blog.csdn.net/xiaoxiaowenqiang/article/details/138919126?spm=1001.2014.3001.5502
https://blog.csdn.net/zhanghm1995/article/details/106015625
- 将命令输出存储到变量中的语法是
diff_result=$(diff stc_compile_multifile_withso_build.log stc_compile_multifile_build.txt | wc -l) keyword_num=$(grep -o 'OFFLOAD' stcc_out_result0.txt| wc -l)
- 条件判断
keyword_num=$(($keyword_num1+$keyword_num2)) if [ $diff_result == 0 ] && [ $keyword_num == 3 ] then echo "stc_compile_multifile_withso_build result Passed." rm -rf stc_compile_multifile_withso_build.log else echo "stc_compile_multifile_withso_build result Failed." mv stc_compile_multifile_withso_
使用set更改shell特性时,符号+和-的作用分别是关闭和打开指定的模式
-
使用 set/env/export 的区别
-
Shell脚本中的:=是什么意思
:= 意思就是 如果这个变量是空的或者未赋初值,则对其进行赋值. 否则, 就不赋值.
https://zhuanlan.zhihu.com/p/264346586
https://blog.csdn.net/x1269778817/article/details/46535729
https://www.cnblogs.com/xuxm2007/archive/2011/10/20/2218846.html
https://handerfly.github.io/shell/2019/04/03/shell编程冒号加-等号-加号-减号-问号/
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Builtin-Commands
https://www.cnblogs.com/itcomputer/p/5035387.html
https://chegva.com/3818.html
https://gist.github.com/maxisam/e39efe89455d26b75999418bf60cf56c#file-bash_strict_mode-md
https://www.cnblogs.com/wjoyxt/category/577808.html
https://www.cnblogs.com/wjoyxt/category/577808.html
http://home.ustc.edu.cn/~xie1993/linux/linux-shell-func.html
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY