Reflect 3 session logs into topic memory files

New: gotchas-skills.md (non-ASCII frontmatter, per-profile skill dirs).
Updated: gotchas-bash.md (+((var++)) with zero), decisions.md (+python3
for JSON), process-lessons.md (+cat -A diagnostic).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-03-17 11:22:20 +13:00
parent 22db5514f8
commit 8e978fef9d
6 changed files with 28 additions and 3 deletions

View File

@@ -16,6 +16,10 @@ Using `local` in the main script body (e.g., inside a `for` loop that isn't wrap
`output=$(cmd)` where `cmd` exits non-zero will trigger `errexit` before `rc=$?` on the next line executes. Use `output=$(cmd) && rc=$? || rc=$?` or `output=$(cmd) || true` to safely capture output from commands expected to fail.
## `((var++))` with var=0 triggers `set -e` exit
Arithmetic expressions like `((PASS++))` return the *pre-increment* value. When PASS=0, the result is 0 (falsy), which `set -e` treats as a failure and silently exits the script. Use `PASS=$((PASS + 1))` instead — assignments always succeed regardless of the computed value.
## `file` command marks shell scripts as "executable"
The `file` command returns strings like "Bourne-Again shell script, Unicode text, UTF-8 text executable" for shell scripts. Grepping for `executable` to detect binaries will false-positive on text scripts. Instead, grep for `binary|image|archive` and additionally check that the output does NOT contain `text`.