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:
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user