Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Christoph Anton Mitterer via austin-group-l at The Open Group
On Thu, 2022-01-27 at 12:44 +, Geoff Clare via austin-group-l at The Open Group wrote: > > It seems to me that there are three cases to consider: > > * The command's output is expected to contain byte sequences that >   might not form valid characters. >   In this case LC_ALL=C should be

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Christoph Anton Mitterer via austin-group-l at The Open Group
On Thu, 2022-01-27 at 18:09 +, Harald van Dijk via austin-group-l at The Open Group wrote: > > I have to disagree. The use of " character" to me clearly > means > that the output of the command is processed as a sequence of > characters, > as opposed to a sequence of bytes. While not being

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Christoph Anton Mitterer via austin-group-l at The Open Group
On Thu, 2022-01-27 at 17:07 +, Harald van Dijk via austin-group-l at The Open Group wrote: > That is not what POSIX says. It says "The value of an environment > variable is a string of characters" (8.1 Environment Variable > Definition), and "character" is defined as "a sequence of one or

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Christoph Anton Mitterer via austin-group-l at The Open Group
On Thu, 2022-01-27 at 15:18 +, Harald van Dijk via austin-group-l at The Open Group wrote: > The benefit of this that when the > shell's locale changes, variables still hold their original text (as > opposed to their original bytes). But doesn't that by itself already violate POSIX? There

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Chet Ramey via austin-group-l at The Open Group
On 1/27/22 12:25 PM, Chet Ramey wrote: On 1/27/22 12:07 PM, Harald van Dijk via austin-group-l at The Open Group wrote: On 27/01/2022 16:06, Chet Ramey via austin-group-l at The Open Group wrote: Wow, that seems like a bug. Environment variables can contain sequences of arbitrary non-NULL

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Harald van Dijk via austin-group-l at The Open Group
On 27/01/2022 17:43, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 27 Jan 2022: On 27/01/2022 12:44, Geoff Clare via austin-group-l at The Open Group wrote: Christoph Anton Mitterer wrote, on 26 Jan 2022: 3) Does POSIX define anywhere which values a shell

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Geoff Clare via austin-group-l at The Open Group
Harald van Dijk wrote, on 27 Jan 2022: > > On 27/01/2022 12:44, Geoff Clare via austin-group-l at The Open Group wrote: > > Christoph Anton Mitterer wrote, on 26 Jan 2022: > > > 3) Does POSIX define anywhere which values a shell variable is required > > > to be able to store? > > > I only

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Chet Ramey via austin-group-l at The Open Group
On 1/27/22 12:07 PM, Harald van Dijk via austin-group-l at The Open Group wrote: On 27/01/2022 16:06, Chet Ramey via austin-group-l at The Open Group wrote: Wow, that seems like a bug. Environment variables can contain sequences of arbitrary non-NULL bytes, and, as long as the portion before

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Harald van Dijk via austin-group-l at The Open Group
On 27/01/2022 16:06, Chet Ramey via austin-group-l at The Open Group wrote: Wow, that seems like a bug. Environment variables can contain sequences of arbitrary non-NULL bytes, and, as long as the portion before the `=' is a valid NAME, the shell is required to create a variable with the

[1003.1(2016/18)/Issue7+TC2 0001531]: time: follow-up to issue #1440

2022-01-27 Thread Austin Group Bug Tracker via austin-group-l at The Open Group
The following issue has been RESOLVED. == https://austingroupbugs.net/view.php?id=1531 == Reported By:steffen Assigned To:

[1003.1(2016/18)/Issue7+TC2 0001530]: nohup: follow-up to issue #1440

2022-01-27 Thread Austin Group Bug Tracker via austin-group-l at The Open Group
The following issue has been RESOLVED. == https://austingroupbugs.net/view.php?id=1530 == Reported By:steffen Assigned To:

[1003.1(2016/18)/Issue7+TC2 0001529]: ex: follow-up to issue #1440

2022-01-27 Thread Austin Group Bug Tracker via austin-group-l at The Open Group
The following issue has been RESOLVED. == https://austingroupbugs.net/view.php?id=1529 == Reported By:steffen Assigned To:

[1003.1(2016/18)/Issue7+TC2 0001529]: ex: follow-up to issue #1440

2022-01-27 Thread Austin Group Bug Tracker via austin-group-l at The Open Group
A NOTE has been added to this issue. == https://austingroupbugs.net/view.php?id=1529 == Reported By:steffen Assigned To:

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Chet Ramey via austin-group-l at The Open Group
On 1/27/22 10:18 AM, Harald van Dijk via austin-group-l at The Open Group wrote: On 27/01/2022 12:44, Geoff Clare via austin-group-l at The Open Group wrote: Christoph Anton Mitterer wrote, on 26 Jan 2022: 3) Does POSIX define anywhere which values a shell variable is required     to be able

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Harald van Dijk via austin-group-l at The Open Group
On 27/01/2022 12:44, Geoff Clare via austin-group-l at The Open Group wrote: Christoph Anton Mitterer wrote, on 26 Jan 2022: 3) Does POSIX define anywhere which values a shell variable is required to be able to store? I only found that NUL is excluded, but that alone doesn't mean that

Re: how do to cmd subst with trailing newlines portable (was: does POSIX mandate whether the output…)

2022-01-27 Thread Geoff Clare via austin-group-l at The Open Group
Christoph Anton Mitterer wrote, on 26 Jan 2022: > > On Tue, 2022-01-25 at 09:25 +, Geoff Clare via austin-group-l at > The Open Group wrote: > > You are correct, and a common method of preserving trailing newlines > > is to append a non-newline character and then strip it, e.g.: > > > >