Loading...
Loading...
Expert in strict POSIX sh scripting for maximum portability across Unix-like systems. Specializes in shell scripts that run on any POSIX-compliant shell (dash, ash, sh, bash --posix).
npx skill4agent add sickn33/antigravity-awesome-skills posix-shell-proresources/implementation-playbook.md[[[<()>(){1..10}localdeclaretypesetreadonly+=${var//pattern/replacement}source.#!/bin/shset -eupipefail"$var"$var[ ][[whilecasegetoptsmktempprintfecho. script.shsource script.sh|| exit 1IFS[ -n "$var" ][ -z "$var" ]--rm -rf -- "$dir"$()date#!/bin/shuname -scommand -vwhichcommand -v cmd >/dev/null 2>&1 || exit 1[ -e "$file" ]/dev/stdin/dev/stdout&>validate_inputcheck[ -r "$file" ] || exit 1case $num in *[!0-9]*) exit 1 ;; esaceval--rm -- "$file"[ -n "$VAR" ] || { echo "VAR required" >&2; exit 1; }cmd || { echo "failed" >&2; exit 1; }traptrap 'rm -f "$tmpfile"' EXIT INT TERMumask 077/bin/rmrmwhile readfor i in $(cat)caseifexpr$(( ))$(( ))grep -q-h--helpset -- item1 item2 item3; for arg; do echo "$arg"; doneitems="a:b:c"; IFS=:; set -- $items; IFS=' 'items="a\nb\nc"; while IFS= read -r item; do echo "$item"; done <<EOFi=0; while [ $i -lt 10 ]; do i=$((i+1)); donecutawk[ ][ -e file ][ -f file ][ -d dir ][ -z "$str" ][ -n "$str" ][ "$a" = "$b" ][ "$a" -eq "$b" ][ "$a" -lt "$b" ][ cond1 ] && [ cond2 ][ cond1 ] || [ cond2 ][ ! -f file ]case[[ =~ ]]shellcheck -s sh *.sh && shfmt -ln posix -d *.sh && checkbashisms *.shmktempseq/tmpcommand -v mktemp >/dev/null 2>&1 || mktemp() { ... }checkbashisms[[[caselocal<()sedawk-s sh-ln posix[[local-s sh-ln posix[[[localechoprintfsource.${var//pattern/replacement}<()>()function$RANDOMread -aset -o pipefail&>>file 2>&1trap 'echo "Error at line $LINENO" >&2; exit 1' EXIT; trap - EXITtmpfile=$(mktemp) || exit 1; trap 'rm -f "$tmpfile"' EXIT INT TERMset -- item1 item2 item3; for arg; do process "$arg"; doneIFS=:; while read -r user pass uid gid; do ...; done < /etc/passwdecho "$str" | sed 's/old/new/g'${str%suffix}value=${var:-default}functionfunc_name() { ... }(cd dir && cmd)cat <<'EOF'command -v cmd >/dev/null 2>&1 && echo "found" || echo "missing""$var"$var[ ][ "$a" = "$b" ]["$a"="$b"]===.sourceprintfecho -eecho -n$(( ))letdeclare -icase[[ =~ ]]sh -n script.shcommand -vtypewhich|| exit 1