bash — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited bash (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
cannot be retrieved via live search.
errors.
set -euo pipefail
IFS=$'\n\t'nounset option temporarily using set +u only when checking for optional positional parameters, thenimmediately re-enable it using set -u.
trap built-in to catch ERR signals and execute cleanup functions, ensuring temporary files or locks areremoved even if the script crashes unexpectedly.
"$VARIABLE" instead of $VARIABLE.command -v at the start of the script before executing anylogic.
missing or invalid.
[[ ]] for conditional tests instead of [ ]; the double-bracket form is safer and supports regex matching.Every non-trivial script must follow this structure:
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Script: script-name.sh
# Description: One-sentence description of what this script does.
# Usage: ./script-name.sh [OPTIONS] <required-arg>
# Options:
# -h, --help Show this help message and exit
# -v, --verbose Enable verbose output
# -----------------------------------------------------------------------------
set -euo pipefail
IFS=$'\n\t'
# --- Constants ---------------------------------------------------------------
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_NAME="$(basename "$0")"
# --- Logging -----------------------------------------------------------------
log_info() { echo "[INFO] $(date -u '+%Y-%m-%dT%H:%M:%SZ') $*" >&2; }
log_warn() { echo "[WARN] $(date -u '+%Y-%m-%dT%H:%M:%SZ') $*" >&2; }
log_error() { echo "[ERROR] $(date -u '+%Y-%m-%dT%H:%M:%SZ') $*" >&2; }
# --- Cleanup -----------------------------------------------------------------
cleanup() {
local exit_code=$?
# Remove temp files, release locks, etc.
exit "$exit_code"
}
trap cleanup EXIT
# --- Argument Parsing --------------------------------------------------------
usage() {
grep '^#' "$0" | sed 's/^# \?//'
exit 0
}
main() {
# Script logic here
:
}
main "$@"getopts for single-character flags; use a manual case statement for long options (--flag).-h / --help that prints usage and exits 0.0 for success.1 for general errors (catch-all).2 for misuse of the script (wrong arguments, missing dependencies).3-125 may be defined per-script for specific error conditions; document them in the header.exit from inside a function; return a non-zero code and let the caller decide.mktemp; never hardcode /tmp/script-name.tmp.cleanup trap; never rely on manual cleanup at the end of the script.mktemp -d for temp directories; remove them with rm -rf "$TMPDIR" inside cleanup.variable scoped to that subprocess.
in ps output).
[[ ]], declare) with a comment if the script might be sourced in a POSIX shcontext.
# shellcheck disable=SCxxxx comment that includes a justification.
See observability-and-logging → "Startup readiness log" for the universal convention (ANSI Shadow banner, URL + profile + dependency + observability sections, 2-second probe timeouts, <url> [Connected|Warning|FAILED] result format).
For shell-implemented long-running services (log aggregators, polling daemons, init wrappers around a child process), cat the banner immediately before exec or the main loop:
cat <<'EOF'
███████╗██╗ ██╗██████╗ ██████╗ ██╗ ██╗███████╗██████╗
██╔════╝██║ ██║██╔══██╗██╔══██╗██║ ██║██╔════╝██╔══██╗
███████╗██║ ██║██████╔╝██████╔╝██║ ██║█████╗ ██████╔╝
╚════██║██║ ██║██╔═══╝ ██╔═══╝ ██║ ██║██╔══╝ ██╔══██╗
███████║╚██████╔╝██║ ██║ ███████╗██║███████╗██║ ██║
╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝
EOFThen the readiness lines (profile, hostname, dependencies, observability), then the exec:
exec /usr/local/bin/my-daemonProbe timeouts: curl --max-time 2 --connect-timeout 2 <url> for each dependency check. Capture the exit code, redirect probe stderr to a debug log file, surface only [Connected] / [FAILED] in the banner:
probe() {
local url="$1"
if curl --silent --output /dev/null --max-time 2 --connect-timeout 2 "$url"; then
printf '%s [Connected]\n' "$url"
else
printf '%s [FAILED]\n' "$url"
fi
}~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.