Shell commands with and without a prompt
shell-prompt-mixon by default (info)Japanese / English
Shell commands written with a "$" prompt in some places and without in others
Example
How to fix
Match the majority. For commands meant to be copied, leaving the prompt out avoids pasting it.
Why it matters
When "$ npm install" and "npm install" both appear in one document, the reader wonders whether to type the "$", and a copied command may fail. chaff compares shell blocks (```bash, ```console) whose every line has a prompt ($) with those where no line has one, and points at the fewer. A block that shows a command with its output (some lines prompted, some not) is not read. Which way is right is not decided.
What it does not flag
Blocks in other languages or without a language, blocks that show a command with its output, and comment lines (#) are not read. When the fewer kind is more than {limit} blocks, it is taken as a choice.
Turning it off or relaxing it
Technical details
- Layer
- L1
- Status
- stable
- Severity
- info
- Languages
- Japanese and English
- Suited to
- technical, docs, blog, legal, academic, literature, speech
- Reads from the document
- markdown
Levels
Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).
| strict | reported when the fewer style appears in 3 blocks or fewer |
|---|---|
| normal | reported when the fewer style appears in 2 blocks or fewer |
| relaxed | reported when the fewer style appears in 1 blocks or fewer |
By genre
- Runs by default in
- technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, docs/manual, docs/faq, docs/glossary
- Turned off by the genre in
- legal/contract, legal/statute, legal/judgment, legal/patent, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript
- Not suited to, and not run in
- business/proposal, business/report, business/email, business/press-release, business/meeting-notes
Message
This block writes its commands with a prompt ($) differently from the other {majority} blocks
Rewrite depth (chaff fix-plan --depth): light — words and sentences; the structure and the voice stay
This page is built from the rule's definition file:packages/chaff/rules/shell-prompt-mix.yaml