posix-shell-pro
编写可移植的 POSIX Shell 脚本
可移植的 shell 脚本在依赖 Bash 扩展或仅 GNU 支持的行为时经常会出错。此技能可帮助 Claude、Codex 和 Claude Code 生成严格的 POSIX sh,并采用更安全的模式和清晰的验证步骤。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "posix-shell-pro" from https://skillstore.io/skills/sickn33-posix-shell-pro.md and its manifest at https://skillstore.io/api/skills/sickn33-posix-shell-pro/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“posix-shell-pro”。 一个 Bash 脚本使用数组、double-bracket 测试和 source 命令。
预期结果:
该技能会识别每个非 POSIX 构造,建议使用位置参数和 case 模式,并列出 dash 和 ShellCheck 的验证步骤。
正在使用“posix-shell-pro”。 一个部署脚本必须在 Alpine、Debian 和 macOS 上运行。
预期结果:
该技能会返回一份可移植性检查清单,涵盖 shell 选择、命令可用性、引用、临时文件和平台特定标志。
正在使用“posix-shell-pro”。 一个团队希望为可移植 shell 脚本设置 CI 检查。
预期结果:
该技能会建议一个多 shell 验证流程,包括格式化、静态分析、bashism 检测和最小容器测试。
安全审计
安全Reviewed SKILL.md and found a documentation-only POSIX shell guide, not executable code. Static findings are false positives from inline examples, reference links, and safe-portability guidance; no prompt injection, exfiltration intent, installer behavior, or malicious network activity was found.
风险因素
⚙️ 外部命令 (50)
🌐 网络访问 (7)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/sickn33-posix-shell-pro/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/sickn33-posix-shell-pro?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/sickn33-posix-shell-pro?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-posix-shell-pro/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/sickn33-posix-shell-pro.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
sickn33. (2026). posix-shell-pro security audit report (audit version 5) [Author version unspecified]. Skillstore. https://skillstore.io/skills/sickn33-posix-shell-pro/audits/5BibTeX 引用
@techreport{sickn33-sickn33-posix-shell-pro-2026,
author = {sickn33},
title = {posix-shell-pro security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/sickn33-posix-shell-pro/audits/5},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "posix-shell-pro security audit report (audit version 5)"
version: "unspecified"
type: report
authors:
- name: "sickn33"
date-released: "2026-07-09"
url: "https://skillstore.io/skills/sickn33-posix-shell-pro/audits/5"
identifiers:
- type: other
value: "skillstore:sickn33-posix-shell-pro:audit:5"
description: "Skillstore immutable audit report identifier"
Skillstore 评分
评分依据 证据置信度: 高你能构建什么
转换 Bash 实用工具
将 Bash-specific 语法替换为 POSIX sh 模式,同时保持行为清晰且可测试。
加固发布脚本
审查部署或打包脚本的引用、错误处理、清理和跨平台可移植性。
支持最小化系统
设计可在 BusyBox ash、Alpine 容器和受限类 Unix 环境中运行的脚本。
试试这些提示
审查这个 shell 脚本是否严格兼容 POSIX sh。列出 Bash-specific 语法、不安全的引用以及简单修复方法。
将这个 Bash 模式转换为 POSIX sh。解释权衡,并包含我之后应运行的验证命令。
为此任务设计一个 POSIX sh 命令行实用工具。包含参数解析、错误处理、清理和可移植性检查。
为此项目创建从 Bash 到 POSIX sh 的迁移计划。优先处理高风险构造、测试、CI 更新和发布步骤。
最佳实践
- 在编写或修改脚本前,询问目标 shell 和操作系统。
- 使用面向 POSIX 的静态分析以及至少一种严格 shell(如 dash 或 ash)验证最终脚本。
- 在演示文件解析或系统检查时,让示例聚焦于中性的样例数据。
避免
- 将该技能用于需要且已记录 Bash 功能的 Bash-only 项目。
- 在未审查路径、引用、权限和输入的情况下,将生成的脚本视为安全。
- 将引用本地系统文件的可移植性示例直接复制到生产脚本中,而不进行替换。