by barrettondricka on 1/1/25, 3:40 PM with 5 comments
The sign makes copy pasting harder, though it might prevent mindless running of commands. Also, $ clarifies that the line is indeed a shell command.
What is your own ideology on using dollar signs in front of shell commands?
What are best practices for providing shell commands in docs?
by pwg on 1/1/25, 3:58 PM
Given that the default unix shell prompt has traditionally been a dollar sign, this use in documentation is likely just a result of attempting to make the docs more closely resemble an actual interactive session view.
> What is your own ideology on using dollar signs in front of shell commands?
Most authors will wish to, in some way, highlight actual commands separately from the surrounding prose. If in a limited typesetting environment (i.e., plain text) then use of $ to prefix commands is one of the very few ways to do so. If in an environment with more highlighting ability (i.e., HTML document) then the author is free to choose a highlight convention that works for their document.
> What are best practices for providing shell commands in docs?
It is probably best to provide some for of "highlight" to indicate the shell commands separately from the prose. What form that "highlight" takes is determined by what formatting is available for the documentation being created.
In any case, the author should be consistent in their usage of the highlight, and it is often good to include, up front, a brief description of the meaning of the highlight so the reader is not left guessing what "bold face, indent" vs "underline, flush" might respectively mean.
by gjvc on 1/1/25, 4:47 PM
That's all there is to it. Move on. Worry about something else.
by gregjor on 1/1/25, 4:28 PM
On the scale of things I care about this ranks pretty close to the bottom.
by dave4420 on 1/1/25, 3:49 PM
by RGamma on 1/2/25, 12:45 PM