posix-shell-pro
Write portable POSIX shell scripts for any Unix system
Shell scripts often fail on different systems due to bash-specific features. This skill ensures your scripts run everywhere using strict POSIX compliance.
์คํฌ ZIP ๋ค์ด๋ก๋
Claude์์ ์ ๋ก๋
์ค์ โ ๊ธฐ๋ฅ โ ์คํฌ โ ์คํฌ ์ ๋ก๋๋ก ์ด๋
ํ ๊ธ์ ์ผ๊ณ ์ฌ์ฉ ์์
ํ ์คํธํด ๋ณด๊ธฐ
"posix-shell-pro" ์ฌ์ฉ ์ค์ ๋๋ค. Create a POSIX script that backs up a directory with validation
์์ ๊ฒฐ๊ณผ:
- #!/bin/sh
- set -eu
- ย
- Usage: backup.sh <source_dir> <dest_dir>
- ย
- if [ $# -lt 2 ]; then
- echo "Error: source and destination required" >&2
- exit 1
- fi
- ย
- src="$1"
- dest="$2"
- ย
- [ -d "$src" ] || { echo "Source not a directory" >&2; exit 1; }
- mkdir -p "$dest" || exit 1
- ย
- tar -cf - -C "$src" . | (cd "$dest" && tar -xf -)
- echo "Backup completed successfully"
"posix-shell-pro" ์ฌ์ฉ ์ค์ ๋๋ค. Check if a command exists portably
์์ ๊ฒฐ๊ณผ:
Use: command -v cmd >/dev/null 2>&1 && echo "found" || echo "missing"
๋ณด์ ๊ฐ์ฌ
์์ This is a prompt-only skill with no executable code. Static analysis scanned 0 files and detected 0 security issues with a risk score of 0/100. The skill provides instructional content on POSIX shell scripting best practices and actually promotes security patterns including input validation, safe variable quoting, cleanup traps, and warnings against eval on untrusted input. No network calls, command execution, or sensitive operations detected.
์ํ ์์ธ
โ๏ธ ์ธ๋ถ ๋ช ๋ น์ด
ํ์ง ์ ์
๋ง๋ค ์ ์๋ ๊ฒ
Cross-platform deployment scripts
Create installation and deployment scripts that work identically on Linux, BSD, macOS, and embedded systems without requiring bash installation.
Container and embedded system tooling
Build lightweight scripts for Alpine Linux, BusyBox, and resource-constrained environments where bash is unavailable.
Legacy system administration
Maintain and modernize scripts for older Unix systems like Solaris, AIX, and legacy Linux that may lack bash or use older versions.
์ด ํ๋กฌํํธ๋ฅผ ์ฌ์ฉํด ๋ณด์ธ์
Create a POSIX-compliant shell script that validates input arguments and performs a simple file operation. Include proper error handling with set -eu, input validation, and cleanup traps.
Convert this bash script to strict POSIX sh. Replace all arrays, [[ conditionals, and bash-specific features with POSIX-compliant equivalents. Explain each change made.
Implement POSIX-compliant argument parsing for a script that accepts -h for help, -v for verbose, -o for output file, and positional arguments. Use while and case without getopts for long options.
Create a POSIX shell function library that handles platform differences between Linux, BSD, macOS, and BusyBox. Include OS detection, command availability checks, and portable implementations of common utilities.
๋ชจ๋ฒ ์ฌ๋ก
- Always quote variable expansions as "$var" to prevent word splitting and globbing
- Use printf instead of echo for all output since echo behavior varies across shells
- Implement cleanup with trap commands to remove temporary files on EXIT INT and TERM signals
ํผํ๊ธฐ
- Using [[ conditionals or bash arrays which fail on dash ash and other POSIX shells
- Using echo -e or echo -n which have inconsistent behavior across different systems
- Using process substitution <() or source command instead of pipes and dot operator
์์ฃผ ๋ฌป๋ ์ง๋ฌธ
What is the difference between POSIX sh and bash?
How do I test if my script is truly POSIX compliant?
Can I use local variables in POSIX sh functions?
What replaces bash arrays in POSIX sh?
Is this skill compatible with Claude Codex and Claude Code?
Will POSIX scripts work in Docker containers?
๊ฐ๋ฐ์ ์ธ๋ถ ์ ๋ณด
์์ฑ์
sickn33๋ผ์ด์ ์ค
MIT
๋ฆฌํฌ์งํ ๋ฆฌ
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/posix-shell-pro์ฐธ์กฐ
main
ํ์ผ ๊ตฌ์กฐ
๐ SKILL.md