Loading...
Loading...
Bash scripting guidelines covering security, portability, error handling, and automation best practices for DevOps.
npx skill4agent add mindrally/skills bash-scriptingbackup_files.shlog_rotationgetoptsshellchecktrapset -euo pipefail#!/usr/bin/env bash
set -euo pipefail
# Trap for cleanup
trap cleanup EXIT
cleanup() {
# Clean up temporary files
rm -f "${TEMP_FILE:-}"
}
# Use functions for modularity
main() {
validate_input "$@"
process_data
}
validate_input() {
[[ $# -lt 1 ]] && { echo "Usage: $0 <arg>"; exit 1; }
}
main "$@"