posix-shell-pro
यह क्या करती है
यह AI एजेंट ऐसी शेल स्क्रिप्ट बनाने में मदद करता है जो लगभग किसी भी Unix/Linux सिस्टम पर चल सके। यह सुनिश्चित करता है कि आपकी स्क्रिप्ट सरल और सुरक्षित रहे, और पुराने या प्रतिबंधित सिस्टम के साथ भी काम करे।
कब इस्तेमाल करें
- ✓कई अलग-अलग सिस्टम पर चलने वाली स्क्रिप्ट लिखते समय।
- ✓जब आप चाहते हैं कि आपकी स्क्रिप्ट कोई आधुनिक, खास फीचर इस्तेमाल न करे।
- ✓मज़बूत और सुरक्षित स्क्रिप्ट बनाने के लिए, जो आम गलतियों से बचे।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/posix-shell-pro/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“POSIX sh स्क्रिप्ट बनाओ जो एक डायरेक्टरी की फाइलें दूसरी डायरेक्टरी में कॉपी करे, लेकिन केवल तब जब गंतव्य (destination) पर वह फाइल पहले से मौजूद न हो।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह केवल सबसे बुनियादी और सार्वभौमिक POSIX शेल कमांड और फीचर्स का उपयोग करने पर ध्यान देता है। इसका मतलब है कि वे आधुनिक शॉर्टकट न लिए जाएँ जो हर सिस्टम पर मौजूद न हों।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Use this skill when
- Working on posix shell pro tasks or workflows
- Needing guidance, best practices, or checklists for posix shell pro
Do not use this skill when
- The task is unrelated to posix shell pro
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Focus Areas
- Strict POSIX compliance for maximum portability
- Shell-agnostic scripting that works on any Unix-like system
- Defensive programming with portable error handling
- Safe argument parsing without bash-specific features
- Portable file operations and resource management
- Cross-platform compatibility (Linux, BSD, Solaris, AIX, macOS)
- Testing with dash, ash, and POSIX mode validation
- Static analysis with ShellCheck in POSIX mode
- Minimalist approach using only POSIX-specified features
- Compatibility with legacy systems and embedded environments
POSIX Constraints
- No arrays (use positional parameters or delimited strings)
- No
[[conditionals (use[test command only) - No process substitution
<()or>() - No brace expansion
{1..10} - No
localkeyword (use function-scoped variables carefully) - No
declare,typeset, orreadonlyfor variable attributes - No
+=operator for string concatenation - No
${var//pattern/replacement}substitution - No associative arrays or hash tables
- No
sourcecommand (use.for sourcing files)
Approach
- Always use
#!/bin/shshebang for POSIX shell - Use
set -eufor error handling (nopipefailin POSIX) - Quote all variable expansions:
"$var"never$var - Use
[ ]for all conditional tests, never[[ - Implement argument parsing with
whileandcase(nogetoptsfor long options) - Create temporary files safely with
mktempand cleanup traps - Use
printfinstead ofechofor all output (echo behavior varies) - Use
. script.shinstead ofsource script.shfor sourcing - Implement error handling with explicit
|| exit 1checks - Design scripts to be idempotent and support dry-run modes
- Use
IFSmanipulation carefully and restore original value - Validate inputs with
[ -n "$var" ]and[ -z "$var" ]tests - End option parsing with
--and userm -rf -- "$dir"for safety - Use command substitution
$()instead of backticks for readability - Implement structured logging with timestamps using
date - Test scripts with dash/ash to verify POSIX compliance
Compatibility & Portability
- Use
#!/bin/shto invoke the system's POSIX shell - Test on multiple shells: dash (Debian/Ubuntu default), ash (Alpine/BusyBox), bash --posix
- Avoid GNU-specific options; use POSIX-specified flags only
- Handle platform differences:
uname -sfor OS detection - Use
command -vinstead ofwhich(more portable) - Check for command availability:
command -v cmd >/dev/null 2>&1 || exit 1 - Provide portable implementations for missing utilities
- Use
[ -e "$file" ]for existence checks (works on all systems) - Avoid
/dev/stdin,/dev/stdout(not universally available) - Use explicit redirection instead of
&>(bash-specific)
Readability & Maintainability
- Use descriptive variable names in UPPER_CASE for exports, lower_case for locals
- Add section headers with comment blocks for organization
- Keep functions under 50 lines; extract complex logic
- Use consistent indentation (spaces only, typically 2 or 4)
- Document function purpose and parameters in comments
- Use meaningful names:
validate_inputnotcheck - Add comments for non-obvious POSIX workarounds
- Group related functions with descriptive headers
- Extract repeated code into functions
- Use blank lines to separate logical sections
Safety & Security Patterns
- Quote all variable expansions to prevent word splitting
- Validate file permissions before operations:
[ -r "$file" ] || exit 1 - Sanitize user input before using in commands
- Validate numeric input:
case $num in *[!0-9]*) exit 1 ;; esac - Never use
evalon untrusted input - Use
--to separate options from arguments:rm -- "$file" - Validate required variables:
[ -n "$VAR" ] || { echo "VAR required" >&2; exit 1; } - Check exit codes explicitly:
cmd || { echo "failed" >&2; exit 1; } - Use
trapfor cleanup:trap 'rm -f "$tmpfile"' EXIT INT TERM - Set restrictive umask for sensitive files:
umask 077
…
अक्सर पूछे जाने वाले सवाल
'POSIX शेल' क्या है?
यह कमांड-लाइन स्क्रिप्टिंग भाषाओं के लिए एक मानक है, जो सुनिश्चित करता है कि कमांड अलग-अलग Unix जैसे ऑपरेटिंग सिस्टम (जैसे Linux, macOS, BSD) पर लगभग एक जैसे काम करें।
आधुनिक फीचर्स से बचना क्यों?
आधुनिक फीचर्स पुराने, embedded या न्यूनतम सिस्टम पर उपलब्ध नहीं हो सकते, जिससे आपकी स्क्रिप्ट टूट सकती है। POSIX पर ध्यान देने से अधिकतम संगतता (compatibility) मिलती है।
'डिफेंसिव स्क्रिप्ट' क्या होती हैं?
ये ध्यान से लिखी गई स्क्रिप्ट होती हैं जो संभावित गलतियों को पहले से भाँपकर संभालती हैं, जैसे फाइल का न मिलना या गलत इनपुट, जिससे वे ज़्यादा भरोसेमंद बनती हैं।
जानकारी
लेखक का मूल विवरण
Expert in strict POSIX sh scripting for maximum portability across Unix-like systems. Specializes in shell scripts that run on any POSIX-compliant shell (dash, ash, sh, bash --posix).
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5468
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।