48 lines
1.8 KiB
Markdown
48 lines
1.8 KiB
Markdown
# Bash Cookbook — Testing for an Interactive Shell (O'Reilly)
|
|||
|
|
|
||
|
|
## Metadata
|
||
|
|
|
||
|
|
| Field | Value |
|
||
|
|
|---|---|
|
||
|
|
| Institute | Molodetz Institute — Research & Retrieval Division |
|
||
|
|
| Subject | shell-multiplexer-auto-attach |
|
||
|
|
| Document type | Source Dossier |
|
||
|
|
| Tier | 1 |
|
||
|
|
| Source title | Bash Cookbook, "Use the following case" excerpt |
|
||
|
|
| Source URL | https://www.oreilly.com/library/view/bash-cookbook/0596526784/ch01s10.html |
|
||
|
|
| Source publisher / author | O'Reilly Media (Bash Cookbook) |
|
||
|
|
| Source type | vendor docs |
|
||
|
|
| Source date (published) | Unknown — not stated |
|
||
|
|
| Date researched | 2026-10-09 |
|
||
|
|
| Researched by | tai (agent), model: Claude Sonnet 5, on behalf of retoor |
|
||
|
|
| Research method | web search synthesis |
|
||
|
|
| Confidence | Medium |
|
||
|
|
| Status | Active |
|
||
|
|
|
||
|
|
## Summary
|
||
|
|
|
||
|
|
An independent, published-book confirmation of the `$-` test, explicitly stating it as the *preferred* method over checking whether `$PS1` is set.
|
||
|
|
|
||
|
|
## Key findings
|
||
|
|
|
||
|
|
- Corroborates the nixCraft guide's recommendation from a second, independent, edited (not just blog) source.
|
||
|
|
- Explicitly ranks `$-` above the `$PS1`-is-set check, rather than treating them as interchangeable.
|
||
|
|
|
||
|
|
## Pros / strengths
|
||
|
|
|
||
|
|
- A published, edited technical book is a stronger signal of broad community consensus than any single blog post — two independent sources agreeing on the same preferred test is meaningful corroboration.
|
||
|
|
|
||
|
|
## Cons / limitations / caveats
|
||
|
|
|
||
|
|
- Older reference material (the Bash Cookbook predates most AI-agent-terminal concerns); it has nothing to say about the automation-vs-human distinction this subject's proposal actually needs.
|
||
|
|
|
||
|
|
## Relevance to tai
|
||
|
|
|
||
|
|
Corroborating evidence (not new information) for using `$-` over `$PS1` as the proposal's first-line interactivity check.
|
||
|
|
|
||
|
|
## Changelog
|
||
|
|
|
||
|
|
| Date | Change |
|
||
|
|
|---|---|
|
||
|
|
| 2026-10-09 | Initial dossier created. |
|