bash

Format and lint bash scripts using shfmt and shellcheck.

34|1|Updated Apr 16, 2012
One-click install
npx skills add https://github.com/meowgorithm/dotfiles --skill bash-meowgorithm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash
Source: https://github.com/meowgorithm/dotfiles/tree/main/crush/skills/bash
Command: npx skills add https://github.com/meowgorithm/dotfiles --skill bash-meowgorithm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires shfmt, shellcheck, and includes scripts (resource) components.

What problem does it solve?

This Skill streamlines the process of creating, editing, and improving bash scripts by providing automated linting and formatting, making it easier to write robust and well-formatted scripts.

Core Features & Use Cases

  • Automated Formatting: Format bash scripts using shfmt for consistency.
  • Automated Linting: Identify and fix common issues in bash scripts with shellcheck.
  • Use Case: Ideal for daily use by developers, sysadmins, or anyone working with bash scripts to ensure code quality and reduce errors.

Quick Start

Format your bash script 'script.sh' with shfmt -w script.sh and then lint it with shellcheck script.sh.

Frequently Asked Questions about bash

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

FAQPage Schema
How do I automate formatting and linting for bash scripts?

You can automate bash script formatting and linting by running shellcheck to identify common errors and shfmt to enforce consistent code styling. This combination improves script robustness and readability.

What is the best way to improve bash script code quality?

The best way to improve bash script code quality is through automated linting with shellcheck to catch issues and formatting with shfmt to maintain consistency. This reduces errors in development and administrative tasks.

Do I need shfmt and shellcheck installed to format and lint bash scripts?

Yes, you need both shfmt and shellcheck installed as dependencies. The Skill requires shfmt to execute script formatting operations and shellcheck to perform automated linting on your bash scripts.

How do I fix common issues in a bash script using shellcheck?

You can fix common issues in a bash script by running shellcheck script.sh to identify errors and improve code quality. Follow the automated linting output to correct syntax and structural problems.

Can I use shfmt to format bash scripts for sysadmin tasks?

Yes, you can use shfmt to format bash scripts for sysadmin tasks. It provides automated formatting to ensure your administrative scripts remain consistent and readable, reducing the likelihood of execution errors.

Why does my bash script fail linting checks during automated processes?

Bash scripts fail linting checks when they contain syntax errors or poor formatting. Running shellcheck identifies these common issues, while shfmt -w script.sh automatically formats the file to meet quality standards.