Bug 247791 - sh(1) incorrectly states that, in PS1, '\$' expands with a trailing space
Summary: sh(1) incorrectly states that, in PS1, '\$' expands with a trailing space
Status: Closed FIXED
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mateusz Piotrowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-05 21:01 UTC by kd-dev
Modified: 2020-07-26 09:47 UTC (History)
2 users (show)

See Also:


Attachments
Remove excess spaces. (380 bytes, patch)
2020-07-05 21:01 UTC, kd-dev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kd-dev 2020-07-05 21:01:22 UTC
Created attachment 216235 [details]
Remove excess spaces.

The description of the "\$" sequence for PS1 does not match the implementation.

From the man-page:
> \$      Superuser status.  “$ ” for normal users and “# ”
>         for superusers.

In use:
$ PS1='\$'
$PS1='\$ '
$ ...

Patch:
The attached patch removes the extra spaces from the man-page.
Comment 1 Mateusz Piotrowski freebsd_committer 2020-07-06 10:05:49 UTC
Nice catch! Thanks!
Comment 2 commit-hook freebsd_committer 2020-07-06 10:05:52 UTC
A commit references this bug:

Author: 0mp
Date: Mon Jul  6 10:05:35 UTC 2020
New revision: 362957
URL: https://svnweb.freebsd.org/changeset/base/362957

Log:
  Fix description of the "\$" sequence for PS1

  The manual page documents "\$" to expand to either "$" or "#" followed by
  a single space. In reality, the single space character is not appended.

  PR:		247791
  Submitted by:	kd-dev@pm.me
  MFC after:	7 days

Changes:
  head/bin/sh/sh.1
Comment 3 commit-hook freebsd_committer 2020-07-26 09:47:12 UTC
A commit references this bug:

Author: 0mp
Date: Sun Jul 26 09:47:02 UTC 2020
New revision: 363544
URL: https://svnweb.freebsd.org/changeset/base/363544

Log:
  MFC 362957:

  Fix description of the "\$" sequence for PS1

  The manual page documents "\$" to expand to either "$" or "#" followed by
  a single space. In reality, the single space character is not appended.

  PR:		247791
  Submitted by:	kd-dev@pm.me

Changes:
_U  stable/12/
  stable/12/bin/sh/sh.1