返回 Skill 列表
extension
分类: 效率与办公无需 API Key

Shell

Shell脚本参考:涵盖Bash语法、重定向、进程替换、信号处理及调试技巧。适用于编写Shell脚本和故障排查。

person作者: xueyetianyahubclawhub

Shell — Shell Scripting Reference

Quick-reference skill for Bash shell scripting, built-in features, and best practices.

When to Use

  • Writing reliable Bash scripts with proper error handling
  • Understanding redirections, pipes, and process substitution
  • Managing signals, traps, and background processes
  • Debugging shell scripts with set options and tracing
  • Choosing between shell features and external tools

Commands

intro

scripts/script.sh intro

Overview of shell scripting — Bash features, shebang, execution, portability.

variables

scripts/script.sh variables

Variables — declaration, scope, arrays, parameter expansion, special variables.

control

scripts/script.sh control

Control flow — if/else, case, for, while, until, select, functions.

redirections

scripts/script.sh redirections

Redirections and pipes — stdin/stdout/stderr, heredocs, process substitution.

safety

scripts/script.sh safety

Safety practices — set -euo pipefail, quoting, shellcheck, error handling.

tools

scripts/script.sh tools

Essential tools — awk, sed, grep, find, xargs, cut, sort, jq patterns.

signals

scripts/script.sh signals

Signals and traps — SIGTERM, SIGINT, cleanup handlers, background jobs.

checklist

scripts/script.sh checklist

Shell script quality checklist.

help

scripts/script.sh help

version

scripts/script.sh version

Configuration

| Variable | Description | |----------|-------------| | SHELL_DIR | Data directory (default: ~/.shell/) |


Powered by BytesAgain | bytesagain.com | hello@bytesagain.com