NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/60706: Improve doc for sh(1)'s pre-command name word expansions
>Number: 60706
>Category: bin
>Synopsis: Improve doc for sh(1)'s pre-command name word expansions
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: doc-bug
>Submitter-Id: net
>Arrival-Date: Thu Sep 10 07:10:00 +0000 2026
>Originator: jarle.greipsland%norid.no@localhost
>Release: NetBSD 10.1_STABLE
>Organization:
Confused shell programmes r us
>Environment:
System: NetBSD ulf.intern.norid.no 10.1_STABLE NetBSD 10.1_STABLE (GENERIC) #6: Thu Jul 30 15:27:49 CEST 2026 root%ulf.intern.norid.no@localhost:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
The sh(1) man page describes the actions of the shell when processing
a simple command. The first step is:
1. Leading words of the form "name=value" are stripped off, the
value is expanded, as described below, and the results are
assigned to the environment of the simple command.[...]
The only relevant description of word expansion I can find in the man
page, is the "full treatment" including field splitting and pathname
expansion. As the leading words assignments are not subject to the
latter two expansions, this ought to be documented. POSIX does this
by having a point 4 in its description of simple commands:
4. Each variable assignment shall be expanded for tilde expansion,
parameter expansion, command substitution, arithmetic expansion,
and quote removal prior to assigning the value.
This text could either be copied verbatim (if copyright allows) into
the sh(1) man page, as a point 4 or inserted into point 1 somewhere,
or some text conveying the same meaning should be added.
>How-To-Repeat:
Read
>Fix:
Write
>Unformatted:
Home |
Main Index |
Thread Index |
Old Index