Bug 247791

Summary: sh(1) incorrectly states that, in PS1, '\$' expands with a trailing space
Product: Documentation Reporter: kd-dev
Component: Manual PagesAssignee: Mateusz Piotrowski <0mp>
Status: Closed FIXED    
Severity: Affects Only Me CC: 0mp, doc
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Remove excess spaces. none

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 freebsd_triage 2020-07-06 10:05:49 UTC
Nice catch! Thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 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 freebsd_triage 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