bash-script-validator

Validate bash and shell scripts for syntax errors and security vulnerabilities.

9|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/pantheon-org/tekhne --skill bash-script-validator-pantheon-org
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-script-validator
Source: https://github.com/pantheon-org/tekhne/tree/main/skills/development/scripting/bash-script/validator
Command: npx skills add https://github.com/pantheon-org/tekhne --skill bash-script-validator-pantheon-org

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps you write robust, secure, and efficient shell scripts by automatically identifying and suggesting fixes for common errors, security vulnerabilities, and portability issues.

Core Features & Use Cases

  • Syntax Checking: Validates script syntax using bash -n or sh -n.
  • Linting: Uses ShellCheck to find bugs, style issues, and suspicious constructs.
  • Security Audits: Detects potential command injection, unsafe eval, and dangerous rm -rf usage.
  • Portability Checks: Identifies bashisms in POSIX shell scripts.
  • Use Case: Before deploying a new automation script, run this Skill to catch potential bugs and security flaws, ensuring it runs reliably across different environments.

Quick Start

Validate the shell script located at '/path/to/your/script.sh'.

Frequently Asked Questions about bash-script-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check a bash script for syntax errors and security vulnerabilities?

To check a bash script for syntax errors and security vulnerabilities, you can use static analysis tools like ShellCheck to identify unquoted variables, unsafe eval usage, and command injection risks. This validation process catches suspicious constructs and ensures reliable execution across different environments.

What is the best way to find bashisms in a POSIX shell script?

The best way to find bashisms in a POSIX shell script is to run a portability check using static analysis. ShellCheck identifies bash-specific constructs that break POSIX compliance, ensuring your shell script executes reliably across different shell environments.

Do I need ShellCheck installed to lint shell scripts?

Yes, you need ShellCheck installed to lint shell scripts for bugs and style issues. If it is not installed globally on your system, you can fulfill this requirement by making it available through a Python virtual environment to execute the static analysis.

How does static analysis detect unsafe eval and command injection in shell scripts?

Static analysis detects unsafe eval and command injection in shell scripts by parsing the code for suspicious constructs without executing it. It identifies unquoted variables and unsafe command execution patterns, suggesting fixes to prevent security vulnerabilities.

Can I validate shell scripts for portability across different environments?

Yes, you can validate shell scripts for portability across different environments by checking for bashisms and syntax errors. Static analysis identifies non-portable constructs, ensuring your automation scripts run reliably regardless of the underlying shell environment.