posix-shell-validator

Solid

Validate scripts for POSIX compliance with portability checks, bashism detection, and cross-platform compatibility.

AI & Automation 814 stars 53 forks Updated today MIT

Install

View on GitHub

Quality Score: 95/100

Stars 20%
97
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# POSIX Shell Validator Validate scripts for POSIX compliance and portability. ## Capabilities - Detect bashisms in shell scripts - Validate POSIX compliance - Check cross-platform compatibility - Identify non-portable constructs - Generate compliance reports - Suggest portable alternatives ## Usage Invoke this skill when you need to: - Validate scripts for POSIX compliance - Detect bashisms before deployment - Ensure cross-platform compatibility - Generate compliance reports ## Common Bashisms to Avoid ```bash # Bashism → POSIX Alternative # Arrays arr=(a b c) # Use: set -- a b c; or newline-separated ${arr[0]} # Use: $1 (after set --) # [[ ]] test [[ $x == y ]] # Use: [ "$x" = "y" ] [[ $x =~ regex ]] # Use: case or expr # String substitution ${var/old/new} # Use: $(echo "$var" | sed 's/old/new/') ${var,,} # Use: $(echo "$var" | tr '[:upper:]' '[:lower:]') ${var^^} # Use: $(echo "$var" | tr '[:lower:]' '[:upper:]') # Arithmetic ((x++)) # Use: x=$((x + 1)) $((x**2)) # Use: $(expr $x \* $x) or awk # Here strings cat <<< "$var" # Use: echo "$var" | cat # Process substitution diff <(cmd1) <(cmd2) # Use: temp files # Brace expansion {1..10} # Use: seq 1 10 file.{txt,md} # Use: file.txt file.md # Local variables local var # Use: var= (function-scoped in many shells) # Source source file # Use: . file # Function syntax fun...

Details

Author
a5c-ai
Repository
a5c-ai/babysitter
Created
4 months ago
Last Updated
today
Language
JavaScript
License
MIT

Related Skills