#!/bin/bash set -euo pipefail cd "$(dirname "$0")/.." if [[ $# -ne 0 && ( $# -ne 2 || $1 != --output || -z $2 ) ]]; then printf 'Usage: %s [--output readings.json]\n' "$0" >&2 exit 2 fi work=$(mktemp -d "${TMPDIR:-/tmp}/parcel-quiet.XXXXXX") trap 'rm -rf "$work"' EXIT # Only the second sample covers the requested five-second interval. top -l 2 -s 5 -stats pid,command,cpu > "$work/top" pmset -g batt > "$work/battery" pmset -g therm > "$work/thermal" pmset -g custom > "$work/settings" Scripts/parcel-dev.sh quiet-readings --top "$work/top" --battery "$work/battery" \ --thermal "$work/thermal" --settings "$work/settings" "$@"