All checks were successful
Reindex Knowledge Base / reindex (push) Successful in 3s
Adds title, description, type, domain, and tags frontmatter to every doc for improved KB semantic search. The description field is prepended to every search chunk, and domain/type/tags enable filtered queries. Type values: context, guide, runbook, reference, troubleshooting Domain values match directory structure (networking, docker, etc.) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1.3 KiB
1.3 KiB
| title | description | type | domain | tags | |||||
|---|---|---|---|---|---|---|---|---|---|
| Bash Scripting Patterns | Bash scripting conventions for script structure, error handling, argument parsing, and security. Covers systemd integration, backup scripts, deployment automation, and monitoring. | context | development |
|
Bash Scripting Patterns
Script Structure
- Use proper shebang (
#!/bin/bash) - Set error handling (
set -euo pipefail) - Include help/usage functions
- Implement proper argument parsing
Best Practices
- Input validation before processing
- Logging and error messages to stderr
- Exit codes for script status
- Function-based organization for reusability
Common Patterns
- Service management with systemd integration
- Backup scripts with rotation and compression
- Deployment automation with rollback capabilities
- System monitoring with alerting
Security Considerations
- Avoid hardcoded credentials
- Use proper file permissions
- Sanitize user inputs
- Quote variables to prevent word splitting
Related Documentation
- Examples:
/examples/bash/service-management.md - Examples:
/examples/bash/backup-scripts.md - Examples:
/examples/bash/deployment-automation.md - Reference:
/reference/bash/troubleshooting.md - Reference:
/reference/bash/security.md