<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Shell on PlumePHP</title><link>https://plumephp.com/categories/shell/</link><description>Recent content in Shell on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Wed, 07 Oct 2026 14:55:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/categories/shell/index.xml" rel="self" type="application/rss+xml"/><item><title>日志轮转与归档</title><link>https://plumephp.com/shell-log-rotation/</link><pubDate>Wed, 07 Oct 2026 14:55:00 +0800</pubDate><guid>https://plumephp.com/shell-log-rotation/</guid><description>系统讲解 logrotate 的策略指令与 postrotate 钩子、压缩延迟与保留期计算、归档到对象存储的生命周期与校验，以及 rename 加 reopen 与 copytruncate 两种模型下的写入安全、竞态规避、容器场景差异与常见踩坑速查。</description></item><item><title>监控采集与告警脚本</title><link>https://plumephp.com/shell-monitoring-alerting/</link><pubDate>Wed, 07 Oct 2026 14:53:00 +0800</pubDate><guid>https://plumephp.com/shell-monitoring-alerting/</guid><description>系统讲解用 Shell 采集系统指标并上报到 textfile collector 或 Pushgateway、阈值判定中的持续时长与迟滞区间、去抖状态机、告警通道集成与去重抑制，以及脚本自身的超时、加锁与心跳可靠性设计，附完整实例与常见踩坑速查表。</description></item><item><title>Shell 处理二进制数据</title><link>https://plumephp.com/shell-binary-data/</link><pubDate>Wed, 07 Oct 2026 14:51:00 +0800</pubDate><guid>https://plumephp.com/shell-binary-data/</guid><description>系统讲解用 xxd、hexdump 与 od 阅读十六进制转储、用 dd 按偏移与长度精确截取数据、用校验和与清单验证文件完整性的做法，并给出定长头加变长体的协议帧手工解析实例、字节回写技巧与常见踩坑排错清单，说明 Shell 处理二进制的边界与替代方案。</description></item><item><title>Shell 脚本的 POSIX 可移植性</title><link>https://plumephp.com/shell-posix-portability/</link><pubDate>Wed, 07 Oct 2026 14:49:00 +0800</pubDate><guid>https://plumephp.com/shell-posix-portability/</guid><description>系统梳理 POSIX sh 与 bash 的语法边界、dash 与 busybox ash 的行为差异、GNU 与 BSD 工具的参数分歧，并给出特性探测与降级写法、容器矩阵验证以及 CI 多平台检查的完整落地方案，附常见报错原因与排错速查表。</description></item><item><title>PowerShell 跨平台脚本</title><link>https://plumephp.com/shell-powershell-crossplatform/</link><pubDate>Wed, 07 Oct 2026 14:47:00 +0800</pubDate><guid>https://plumephp.com/shell-powershell-crossplatform/</guid><description>讲解 PowerShell 的对象管道与 cmdlet 体系、与 POSIX 工具的双向互操作、SSH 远程执行与凭据管理，并系统梳理 Linux 与 macOS 上的跨平台差异、编码陷阱、CI 落地要点与常见排错速查表，给出可复用的跨平台脚本骨架。</description></item><item><title>现代 Shell：fish、nushell 与迁移</title><link>https://plumephp.com/shell-modern-shells/</link><pubDate>Wed, 07 Oct 2026 14:45:00 +0800</pubDate><guid>https://plumephp.com/shell-modern-shells/</guid><description>系统对比 fish 与 nushell 相对 bash 的语法与数据模型差异，讲解结构化管道、外部命令互操作、配置体系与脚本模式，并给出交互层迁移、脚本层保守化、CI 能力探测降级与团队共存的完整落地路径，附常见踩坑与排错速查表，帮助在保留部署链路稳定的前提下升级终端体验。</description></item><item><title>任务编排与 Makefile 实战</title><link>https://plumephp.com/shell-make-task-runner/</link><pubDate>Fri, 02 Oct 2026 15:00:00 +0800</pubDate><guid>https://plumephp.com/shell-make-task-runner/</guid><description>把 make 当作任务运行器而非构建工具：目标与依赖的语义、PHONY 与增量判断、并行执行、变量与函数，以及与 just、task 的取舍和迁移路径。</description></item><item><title>文件监控与事件驱动流水线实战</title><link>https://plumephp.com/shell-inotify-file-watch/</link><pubDate>Fri, 02 Oct 2026 14:00:00 +0800</pubDate><guid>https://plumephp.com/shell-inotify-file-watch/</guid><description>讲解 inotifywait 与 fswatch 的事件模型、事件去抖与合并、触发式流水线的可靠性设计、watcher 数量与容器内限制，以及替代轮询的适用边界。</description></item><item><title>结构化数据清洗与报表生成实战</title><link>https://plumephp.com/shell-csv-data-wrangling/</link><pubDate>Fri, 02 Oct 2026 13:00:00 +0800</pubDate><guid>https://plumephp.com/shell-csv-data-wrangling/</guid><description>面向 CSV 与 TSV 的清洗流水线：csvkit 与 miller 的取舍、awk 字段处理、引号与转义陷阱、编码转换、字段校验与聚合，最终生成可直接交付的报表。</description></item><item><title>并发控制与文件锁实战</title><link>https://plumephp.com/shell-file-locking-concurrency/</link><pubDate>Fri, 02 Oct 2026 12:00:00 +0800</pubDate><guid>https://plumephp.com/shell-file-locking-concurrency/</guid><description>从竞态条件的本质出发，讲解 flock 的两种用法、锁文件与原子创建、任务去重、锁超时与陈旧锁清理，以及多进程安全追加日志的工程模式。</description></item><item><title>日期时间与时区处理实战</title><link>https://plumephp.com/shell-date-time-timezone/</link><pubDate>Fri, 02 Oct 2026 11:00:00 +0800</pubDate><guid>https://plumephp.com/shell-date-time-timezone/</guid><description>系统梳理 date 命令的格式化与解析、GNU 与 BSD 的参数差异、UTC 与本地时区换算、epoch 时间戳的比较，以及跨时区定时调度的常见陷阱与解法。</description></item><item><title>文件查找与批量操作实战</title><link>https://plumephp.com/shell-find-file-search-batch/</link><pubDate>Fri, 02 Oct 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/shell-find-file-search-batch/</guid><description>从 find 表达式求值模型讲起，覆盖 fd 与 ripgrep 的现代替代、-exec 与 xargs 的取舍、特殊文件名与路径安全、去重与剪枝，最后落到一条可预演的批量清理流水线。</description></item><item><title>环境初始化与引导脚本设计</title><link>https://plumephp.com/shell-bootstrap-provisioning/</link><pubDate>Thu, 01 Oct 2026 21:00:00 +0800</pubDate><guid>https://plumephp.com/shell-bootstrap-provisioning/</guid><description>系统讲解引导脚本的工程化设计：系统与依赖探测、幂等的包安装、配置文件落盘、失败回滚与自检，以及云初始化场景下的可重复执行实践。</description></item><item><title>云 CLI 自动化脚本实践</title><link>https://plumephp.com/shell-cloud-cli-automation/</link><pubDate>Thu, 01 Oct 2026 20:00:00 +0800</pubDate><guid>https://plumephp.com/shell-cloud-cli-automation/</guid><description>系统讲解 aws、az、gcloud 三大云 CLI 的脚本化用法：结构化输出与 jq 解析、分页与等待收敛、幂等资源管理、凭据与区域配置的安全实践。</description></item><item><title>图片与媒体批处理实战</title><link>https://plumephp.com/shell-image-media-batch/</link><pubDate>Thu, 01 Oct 2026 19:00:00 +0800</pubDate><guid>https://plumephp.com/shell-image-media-batch/</guid><description>系统讲解 ImageMagick 与 ffmpeg 的批量处理：尺寸与格式转换、并行与断点续跑、EXIF 元数据读写与剥离、转码校验与失败重试的工程化实践。</description></item><item><title>数据库 CLI 自动化实战</title><link>https://plumephp.com/shell-database-cli-automation/</link><pubDate>Thu, 01 Oct 2026 18:00:00 +0800</pubDate><guid>https://plumephp.com/shell-database-cli-automation/</guid><description>系统讲解 psql 与 mysql 客户端的批处理用法：连接参数安全传递、事务与错误处理、批量导出导入、慢查询与锁排查，以及幂等迁移脚本的工程化实践。</description></item><item><title>密钥与凭据处理的安全实践</title><link>https://plumephp.com/shell-secrets-credential-handling/</link><pubDate>Thu, 01 Oct 2026 17:00:00 +0800</pubDate><guid>https://plumephp.com/shell-secrets-credential-handling/</guid><description>系统讲解 Shell 脚本中凭据的安全流转：避免明文硬编码、文件权限与内存保护、keyring 与 Vault 动态取用、日志脱敏与进程参数泄露防护。</description></item><item><title>终端界面与交互式 TUI 脚本</title><link>https://plumephp.com/shell-text-ui-tui/</link><pubDate>Thu, 01 Oct 2026 16:00:00 +0800</pubDate><guid>https://plumephp.com/shell-text-ui-tui/</guid><description>系统讲解 Shell 脚本的终端界面构建：dialog 与 whiptail 的对话框组件、fzf 模糊选择、菜单与进度反馈封装，以及 CI 环境下非交互降级的设计原则。</description></item><item><title>备份与 rsync 同步：增量、快照与恢复演练</title><link>https://plumephp.com/shell-backup-rsync-strategies/</link><pubDate>Thu, 01 Oct 2026 15:00:00 +0800</pubDate><guid>https://plumephp.com/shell-backup-rsync-strategies/</guid><description>讲解 rsync 的增量同步与尾斜杠语义、排除规则与删除策略、硬链接快照与轮转、校验与完整性检查、异地加密同步与保留策略，以及恢复演练的完整流程。</description></item><item><title>脚本性能优化实战</title><link>https://plumephp.com/shell-performance-optimization/</link><pubDate>Thu, 01 Oct 2026 15:00:00 +0800</pubDate><guid>https://plumephp.com/shell-performance-optimization/</guid><description>系统讲解 Shell 脚本性能优化的核心路径：启动开销与解析成本、子进程与外部命令的代价、内置命令优先、命令缓存与哈希、大文件流式处理，以及基准测试与性能剖析的方法论。</description></item><item><title>部署与发布脚本：版本、回滚与健康检查</title><link>https://plumephp.com/shell-deployment-release/</link><pubDate>Thu, 01 Oct 2026 15:00:00 +0800</pubDate><guid>https://plumephp.com/shell-deployment-release/</guid><description>系统讲解发布脚本的目标与原则、构建产物管理与版本号语义化、部署步骤编排、健康检查与自动回滚，以及发布门禁与审批流的设计实现。</description></item><item><title>日志解析与聚合：从一堆文本到可告警的指标</title><link>https://plumephp.com/shell-log-parsing-aggregation/</link><pubDate>Thu, 01 Oct 2026 14:00:00 +0800</pubDate><guid>https://plumephp.com/shell-log-parsing-aggregation/</guid><description>讲解如何用 grep/awk/sed 按模式提取日志字段、按时间窗口做滚动统计与去重、计算错误率并触发阈值告警，并给出与 sort/uniq 组合的实战套路。</description></item><item><title>终端 UI 与进度条：ANSI 控制码</title><link>https://plumephp.com/shell-terminal-progress-ansi/</link><pubDate>Thu, 01 Oct 2026 14:00:00 +0800</pubDate><guid>https://plumephp.com/shell-terminal-progress-ansi/</guid><description>系统讲解 ANSI 转义序列控制颜色与光标、用回车与 tput 实现动态进度条、交互式输入与菜单选择，以及信号捕获和终端状态恢复的工程要点。</description></item><item><title>网络请求与诊断实战</title><link>https://plumephp.com/shell-curl-network-diagnostics/</link><pubDate>Thu, 01 Oct 2026 14:00:00 +0800</pubDate><guid>https://plumephp.com/shell-curl-network-diagnostics/</guid><description>系统讲解 curl 的进阶参数与 HTTP 请求方法、下载上传、代理与认证、重试容错，HTTP 状态码诊断，以及 DNS 解析与网络连通性排查的完整实践。</description></item><item><title>Git 自动化实践：hooks 与发布脚本</title><link>https://plumephp.com/shell-git-automation-hooks/</link><pubDate>Thu, 01 Oct 2026 13:00:00 +0800</pubDate><guid>https://plumephp.com/shell-git-automation-hooks/</guid><description>系统讲解 Git hooks 的机制与编写、commit-msg 提交规范校验、批量仓库操作，以及版本号管理、changelog 生成与一键发布流水线的完整实践。</description></item><item><title>定时任务调度实战</title><link>https://plumephp.com/shell-cron-schedule-jobs/</link><pubDate>Thu, 01 Oct 2026 13:00:00 +0800</pubDate><guid>https://plumephp.com/shell-cron-schedule-jobs/</guid><description>系统讲解 cron 的字段语法与 crontab 管理、环境与路径陷阱、日志与错误处理，at 与 Anacron 的补充场景，systemd timer 的现代替代，以及任务重叠防护的完整实践。</description></item><item><title>容器 entrypoint 与信号处理：做对 PID 1 该做的事</title><link>https://plumephp.com/shell-container-entrypoint/</link><pubDate>Thu, 01 Oct 2026 13:00:00 +0800</pubDate><guid>https://plumephp.com/shell-container-entrypoint/</guid><description>讲解容器中 PID 1 的特殊语义、exec 与信号转发、SIGTERM 优雅退出、配置渲染与首次初始化，以及 tini/dumb-init 与健康检查脚本的正确用法。</description></item><item><title>SSH 远程自动化实战</title><link>https://plumephp.com/shell-ssh-remote-automation/</link><pubDate>Thu, 01 Oct 2026 12:00:00 +0800</pubDate><guid>https://plumephp.com/shell-ssh-remote-automation/</guid><description>系统讲解 SSH 客户端配置与免密登录、ssh-agent 密钥托管、远程执行命令与脚本、rsync 增量同步，以及隧道转发、安全加固与批量主机管理的完整实践。</description></item><item><title>systemd 单元与定时器：让脚本成为系统服务</title><link>https://plumephp.com/shell-systemd-units-timers/</link><pubDate>Thu, 01 Oct 2026 12:00:00 +0800</pubDate><guid>https://plumephp.com/shell-systemd-units-timers/</guid><description>讲解如何用 systemd 的 service 单元托管 Shell 脚本、用 timer 单元替代 cron 做定时调度，覆盖重启策略、依赖与顺序、journald 日志以及与 cron 的取舍。</description></item><item><title>结构化数据处理：jq 与 yq 实战</title><link>https://plumephp.com/shell-json-yaml-processing/</link><pubDate>Thu, 01 Oct 2026 12:00:00 +0800</pubDate><guid>https://plumephp.com/shell-json-yaml-processing/</guid><description>系统讲解 jq 的过滤器、管道与数组操作，yq 对 YAML 的读取与修改，以及从 API 响应提取数据、生成与合并配置文件的完整实战套路。</description></item><item><title>xargs 与并行处理实战</title><link>https://plumephp.com/shell-xargs-parallel/</link><pubDate>Thu, 01 Oct 2026 11:00:00 +0800</pubDate><guid>https://plumephp.com/shell-xargs-parallel/</guid><description>系统讲解 xargs 的参数传递模型与占位符、-I 与 -0 处理空格和换行，-P 并行执行与退出码语义，并延伸 GNU parallel 的并行下载与批量任务实战。</description></item><item><title>文件与 IO 进阶：重定向与文件锁</title><link>https://plumephp.com/shell-file-io-redirection/</link><pubDate>Thu, 01 Oct 2026 11:00:00 +0800</pubDate><guid>https://plumephp.com/shell-file-io-redirection/</guid><description>系统讲解文件描述符与重定向的底层语义、进程替换与 Here 字符串、临时文件配合 trap 的清理策略，以及 flock 文件锁与原子写入在并发安全中的落地实践。</description></item><item><title>脚本测试与静态检查：Bats 与 shellcheck 实战</title><link>https://plumephp.com/shell-testing-bats-shellcheck/</link><pubDate>Thu, 01 Oct 2026 11:00:00 +0800</pubDate><guid>https://plumephp.com/shell-testing-bats-shellcheck/</guid><description>讲解如何用 Bats 为 Shell 脚本编写用例与断言、搭建 setup 与 teardown 夹具、mock 外部命令，并用 shellcheck 做静态检查与规则豁免，最后接入 CI 与覆盖率统计。</description></item><item><title>zsh 与 bash 兼容移植：差异剖析与可移植写法</title><link>https://plumephp.com/shell-zsh-bash-compat/</link><pubDate>Thu, 01 Oct 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/shell-zsh-bash-compat/</guid><description>系统对比 zsh 与 bash 在数组与关联数组、glob 展开、参数扩展修饰符、shebang 与启动文件、严格模式行为上的差异，并给出可移植写法清单与迁移实践。</description></item><item><title>交互式命令自动化：expect 与 pty</title><link>https://plumephp.com/shell-expect-interactive-pty/</link><pubDate>Thu, 01 Oct 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/shell-expect-interactive-pty/</guid><description>系统讲解交互式命令自动化的两大路径：expect 的 spawn/expect/send 三件套驱动 SSH 登录与菜单操作，以及 heredoc 与管道喂输入的轻量方案，并给出超时处理与场景封装的工程实践。</description></item><item><title>数组与函数进阶</title><link>https://plumephp.com/shell-arrays-assoc-functions/</link><pubDate>Thu, 01 Oct 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/shell-arrays-assoc-functions/</guid><description>系统讲解 Bash 索引数组与关联数组的声明、遍历与常用操作，函数的参数传递、返回值捕获、作用域与递归，以及如何用函数封装数组操作写出声明式风格的脚本。</description></item><item><title>调试技巧与安全防护</title><link>https://plumephp.com/shell-debug-security/</link><pubDate>Wed, 30 Sep 2026 15:00:00 +0800</pubDate><guid>https://plumephp.com/shell-debug-security/</guid><description>系统讲解 set -x 追踪调试与 DEBUG 陷阱断点、常见运行时错误定位，以及引号注入、eval 危险、临时文件与权限等 Shell 脚本安全防护实战。</description></item><item><title>脚本工程化与规范</title><link>https://plumephp.com/shell-scripting-engineering/</link><pubDate>Wed, 30 Sep 2026 14:00:00 +0800</pubDate><guid>https://plumephp.com/shell-scripting-engineering/</guid><description>从脚本走向工程：讲解 set -euo pipefail 严格模式、函数库与代码组织、ShellCheck 静态检查、日志规范、单元测试与 CI 集成的完整实践。</description></item><item><title>参数解析与错误处理</title><link>https://plumephp.com/shell-params-error-handling/</link><pubDate>Wed, 30 Sep 2026 13:00:00 +0800</pubDate><guid>https://plumephp.com/shell-params-error-handling/</guid><description>系统讲解 Shell 脚本的位置参数与 shift 移位、getopts 选项解析、IFS 字段分隔控制，以及退出码、错误捕获与输入校验的完整方案。</description></item><item><title>进程、管道与信号控制</title><link>https://plumephp.com/shell-process-pipe-signal/</link><pubDate>Wed, 30 Sep 2026 12:00:00 +0800</pubDate><guid>https://plumephp.com/shell-process-pipe-signal/</guid><description>深入 Shell 进程模型，讲解子进程与 subshell 的边界、后台作业控制、管道与 FIFO 通信、exec 进程替换，以及 trap 信号处理实现优雅退出。</description></item><item><title>awk 与 sed 文本处理实战</title><link>https://plumephp.com/shell-text-processing-awk-sed/</link><pubDate>Wed, 30 Sep 2026 11:00:00 +0800</pubDate><guid>https://plumephp.com/shell-text-processing-awk-sed/</guid><description>系统讲解 sed 的行寻址与流编辑命令、awk 的 FS/OFS 字段模型与 NF/NR 内建变量，以及两者组合处理日志与配置文件的完整实战。</description></item><item><title>Shell 脚本编程专题：从命令基础到工程化实践</title><link>https://plumephp.com/posts/shell/</link><pubDate>Wed, 30 Sep 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/posts/shell/</guid><description>Shell 是 Linux/Unix 系统管理、DevOps 自动化与脚本编程的基石语言。本专题系统覆盖变量、流程控制与函数、awk 与 sed 文本处理、进程管道与信号控制、参数解析与错误处理、脚本工程化与规范，以及调试技巧与安全防护，帮助开发者写出健壮、可维护、安全的 Shell 脚本。</description></item><item><title>变量、流程控制与函数</title><link>https://plumephp.com/shell-variables-flow-functions/</link><pubDate>Wed, 30 Sep 2026 10:00:00 +0800</pubDate><guid>https://plumephp.com/shell-variables-flow-functions/</guid><description>系统讲解 Shell 变量的词分裂机制、单双引号差异与 ${var:-default} 默认值语法，以及 if/for/while/case 流程控制和函数定义的完整实战。</description></item></channel></rss>