docs(bash): make the pgrep self-match section about misreading, not just killing
The existing warning only covered piping a self-match into kill. The quieter failure is reading your own shell's PID as "the app is running" and refusing to touch its config — which is exactly what happened while rotating webhooks in a closed VRCNext. Adds: always pass -a so a self-match is visible; prefer -ax (name only, never scans arguments) for "is it running?"; -A/--ignore-ancestors as the fix when -f is unavoidable; and why the [b]racket trick is weaker than it looks — the term can appear elsewhere on the same command line. Points at systemctl is-active for supervised units. cli-tooling.md gains a one-line orientation pointer rather than a copy. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5029ce5e8b
commit
1b688d128c
2 files changed
+43
-2
No files matched your search
@@ -111,6 +111,11 @@ In rough order of value:
|
||||
files, scoped to the project directory.
|
||||
4. **The code itself** — `grep` for the symbol before trusting any document that says it is
|
||||
missing.
|
||||
5. **Whether the thing is already running** — before editing a live app's config or starting a
|
||||
second copy. Ask the supervisor (`systemctl --user is-active <unit>`) and, for a bare
|
||||
process, `pgrep -ax <name>` — never bare `pgrep -f <name>`, which matches your own shell and
|
||||
reads as a false positive. See
|
||||
[`code-languages/bash.md`](code-languages/bash.md#pgrep--f-matches-its-own-shell).
|
||||
|
||||
> [!CAUTION]
|
||||
> **Task documents are leads, not facts.** A `TODO.md` entry can be stale, duplicated, or
|
||||
|
||||
Reference in new issue
Block a user