Re: sh 'continue' shenanigans: negating

2024-02-14 Thread Harald van Dijk via austin-group-l at The Open Group
On 13/02/2024 22:38, Harald van Dijk via austin-group-l at The Open Group wrote: On 13/02/2024 21:04, Thorsten Glaser via austin-group-l at The Open Group wrote: > After all, the continue utility doesn't know it's called by the ! construct. In ash-derived shells, this basically works beca

Re: sh 'continue' shenanigans: negating

2024-02-14 Thread Harald van Dijk via austin-group-l at The Open Group
On 14/02/2024 07:54, Oğuz wrote: On Wed, Feb 14, 2024 at 9:58 AM Harald van Dijk wrote: The test script with 'return'? I mean this one: for x in y; do ! continue done echo $? Ah, thanks for the clarification. I still do not see the same results as you (I still see

Re: sh 'continue' shenanigans: negating

2024-02-13 Thread Harald van Dijk via austin-group-l at The Open Group
On 14/02/2024 06:16, Oğuz wrote: On Wed, Feb 14, 2024 at 8:47 AM Harald van Dijk wrote: POSIX specifies: > The value of the special parameter '?' shall be set to n, an unsigned decimal integer, or to the exit status of the last command executed if n is not specified. In your example

Re: sh 'continue' shenanigans: negating

2024-02-13 Thread Harald van Dijk via austin-group-l at The Open Group
1. Cheers, Harald van Dijk

Re: sh 'continue' shenanigans: negating

2024-02-13 Thread Harald van Dijk via austin-group-l at The Open Group
utilities, does know it's called by the ! construct, because the call is wrapped in a function that checks if the result was negated. But there are other ways to make this work too. Cheers, Harald van Dijk

Re: probable UB in recently accepted text

2023-07-29 Thread Harald van Dijk via austin-group-l at The Open Group
if evaluated, but the expression isn't evaluated, and is not used in a context that requires a constant expression, the implementation must accept it. https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_109.html https://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_132.html Cheers, Harald van Dijk

Re: $? behaviour after comsub in same command

2023-04-06 Thread Harald van Dijk via austin-group-l at The Open Group
On 05/04/2023 18:05, Harald van Dijk via austin-group-l at The Open Group wrote: On 05/04/2023 17:44, Oğuz wrote: 5 Nisan 2023 Çarşamba tarihinde Harald van Dijk <mailto:a...@gigawatt.nl>> yazdı:     I am not sure which other ash based shells you were looking at, /bin/sh on NetBSD an

Re: $? behaviour after comsub in same command

2023-04-06 Thread Harald van Dijk via austin-group-l at The Open Group
On 06/04/2023 20:03, Chet Ramey via austin-group-l at The Open Group wrote: On 4/6/23 1:55 PM, Harald van Dijk wrote: One additional data point: in schily-2021-09-18, Jörg's last release, obosh, the legacy non-POSIX shell that is just there for existing scripts and for portability testing

Re: $? behaviour after comsub in same command

2023-04-06 Thread Harald van Dijk via austin-group-l at The Open Group
On 06/04/2023 16:17, Chet Ramey wrote: On 4/5/23 12:36 PM, Harald van Dijk wrote: On 05/04/2023 15:35, Chet Ramey via austin-group-l at The Open Group wrote: On 4/5/23 9:06 AM, Martijn Dekker via austin-group-l at The Open Group wrote: Consider: false || echo $(true) $? dash, mksh

Re: $? behaviour after comsub in same command

2023-04-05 Thread Harald van Dijk via austin-group-l at The Open Group
On 05/04/2023 17:44, Oğuz wrote: 5 Nisan 2023 Çarşamba tarihinde Harald van Dijk <mailto:a...@gigawatt.nl>> yazdı: I am not sure which other ash based shells you were looking at, /bin/sh on NetBSD and FreeBSD Thanks. I indeed see the same results as you on a recent version of

Re: $? behaviour after comsub in same command

2023-04-05 Thread Harald van Dijk via austin-group-l at The Open Group
h, and my own) keep it that way. I am not sure which other ash based shells you were looking at, but it may be worth making sure you are on a current version. Cheers, Harald van Dijk

Re: $? behaviour after comsub in same command

2023-04-05 Thread Harald van Dijk via austin-group-l at The Open Group
as sufficiently clear, but does clear up with new wording that regardless of whether this can be inferred from the current wording of the standard, this interpretation is the intended one. Cheers, Harald van Dijk

Re: Syntax error with "command . file" (was: [1003.1(2016/18)/Issue7+TC2 0001629]: Shell vs. read(2) errors on the script)

2023-03-14 Thread Harald van Dijk via austin-group-l at The Open Group
On 15/03/2023 00:17, Chet Ramey wrote: On 3/14/23 4:58 PM, Harald van Dijk wrote: On 14/03/2023 20:41, Chet Ramey wrote: On 3/12/23 10:19 PM, Harald van Dijk via austin-group-l at The Open Group wrote: bash appears to disables the reading of .profile in POSIX mode entirely. This isn't

Re: Syntax error with "command . file" (was: [1003.1(2016/18)/Issue7+TC2 0001629]: Shell vs. read(2) errors on the script)

2023-03-14 Thread Harald van Dijk via austin-group-l at The Open Group
On 14/03/2023 20:41, Chet Ramey wrote: On 3/12/23 10:19 PM, Harald van Dijk via austin-group-l at The Open Group wrote: bash appears to disables the reading of .profile in POSIX mode entirely. This isn't quite correct. By default, a login shell named `sh' or `-sh' reads /etc/profile

Re: Syntax error with "command . file" (was: [1003.1(2016/18)/Issue7+TC2 0001629]: Shell vs. read(2) errors on the script)

2023-03-12 Thread Harald van Dijk via austin-group-l at The Open Group
On 12/03/2023 19:10, Robert Elz wrote: Date:Fri, 10 Mar 2023 23:40:18 + From:"Harald van Dijk via austin-group-l at The Open Group" Message-ID: | Based on past experiences, I am assuming the e-mail this is a reply to | was meant

Re: [1003.1(2016)/Issue7+TC2 0001234]: in most shells, backslash doesn't have two meaning wrt pattern matching

2023-03-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 27/06/2019 09:29, Stephane Chazelas wrote: 2019-06-27 08:59:29 +0100, Harald van Dijk: [...] If there is no fnmatch() implementation that behaves that way, then agreed that it makes sense to just specify that. That pax example in the rationale should then also be changed to not escape any

Re: Syntax error with "command . file" (was: [1003.1(2016/18)/Issue7+TC2 0001629]: Shell vs. read(2) errors on the script)

2023-03-10 Thread Harald van Dijk via austin-group-l at The Open Group
Based on past experiences, I am assuming the e-mail this is a reply to was meant to be sent to the list and I am quoting it in full and replying on the list for that reason. On 10/03/2023 21:24, Robert Elz wrote: Date:Fri, 10 Mar 2023 18:13:00 + From:"Haral

Re: Syntax error with "command . file" (was: [1003.1(2016/18)/Issue7+TC2 0001629]: Shell vs. read(2) errors on the script)

2023-03-10 Thread Harald van Dijk via austin-group-l at The Open Group
makes sense to them and keep it internally consistent, whether that is by ignoring what 1629 specifies, or by ignoring what is required for syntax errors. There are more issues that make me doubt this is going to be implemented as written in other shells too, but that's for the other authors to raise. Cheers, Harald van Dijk

Re: Writing the "[job] pid" for async and-or lists

2023-02-24 Thread Harald van Dijk via austin-group-l at The Open Group
hells of interactive shells and already don't in various existing shells (but the extent to which they don't varies from shell to shell). Rather than make a special exception for process IDs, could this be made a general rule? Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001614]: XSH 3/mktime does not specify EINVAL and should

2022-11-25 Thread Harald van Dijk via austin-group-l at The Open Group
g through that logic, and an implementation that is indistinguishable from a conforming one is itself conforming. Cheers, Harald van Dijk

Re: [Issue 8 drafts 0001564]: clariy on what (character/byte) strings pattern matching notation should work

2022-05-19 Thread Harald van Dijk via austin-group-l at The Open Group
On 20/05/2022 01:11, Christoph Anton Mitterer wrote: On Thu, 2022-05-19 at 09:05 +0100, Harald van Dijk wrote: The above, AFAIU, mean that any shell/fnmatch matches a valid multibyte character... but also a byte that is not a character in the locale. Correct, though as I wrote later

Re: [Issue 8 drafts 0001564]: clariy on what (character/byte) strings pattern matching notation should work

2022-05-19 Thread Harald van Dijk via austin-group-l at The Open Group
On 15/05/2022 16:14, Harald van Dijk via austin-group-l at The Open Group wrote: On 19/04/2022 01:52, Harald van Dijk via austin-group-l at The Open Group wrote: On 15/04/2022 04:57, Christoph Anton Mitterer wrote: On Fri, 2022-04-15 at 00:44 +0100, Harald van Dijk via austin-group-l

Re: [Issue 8 drafts 0001564]: clariy on what (character/byte) strings pattern matching notation should work

2022-05-19 Thread Harald van Dijk via austin-group-l at The Open Group
On 19/05/2022 02:46, Christoph Anton Mitterer wrote: On Sun, 2022-05-15 at 16:14 +0100, Harald van Dijk wrote: Please see the tests and results here. So dash/ash/mksh/posh/pdksh,... and every other shell that doesn't handle locales at all (and thus works in the C locale)... is anyway always

Re: [Issue 8 drafts 0001564]: clariy on what (character/byte) strings pattern matching notation should work

2022-05-15 Thread Harald van Dijk via austin-group-l at The Open Group
On 19/04/2022 01:52, Harald van Dijk via austin-group-l at The Open Group wrote: On 15/04/2022 04:57, Christoph Anton Mitterer wrote: On Fri, 2022-04-15 at 00:44 +0100, Harald van Dijk via austin-group-l at The Open Group wrote: If there is interest in getting this standardised, I can spend

Re: POSIX bind_textdomain_codeset(): some invalid codeset arguments

2022-05-13 Thread Harald van Dijk via austin-group-l at The Open Group
On 13/05/2022 14:28, Steffen Nurpmeso wrote: You again strip content of follow-up RFCs. In my previous message, I quoted your message that I replied to in full. I stripped absolutely nothing and do not appreciate your utterly false claim here. Retract it. Harald van Dijk

Re: POSIX bind_textdomain_codeset(): some invalid codeset arguments

2022-05-13 Thread Harald van Dijk via austin-group-l at The Open Group
On 12/05/2022 23:10, Steffen Nurpmeso wrote: Harald van Dijk wrote in : |On 12/05/2022 18:19, Steffen Nurpmeso via austin-group-l at The Open |Group wrote: |> Bruno Haible wrote in |> <4298913.vrqWZg68TM@omega>: |>|Steffen Nurpmeso wrote: |>|> .

Re: POSIX bind_textdomain_codeset(): some invalid codeset arguments

2022-05-12 Thread Harald van Dijk via austin-group-l at The Open Group
ther characters, including U+, must be encoded using rule 2. GNU iconv is doing what the RFC specifies here. Cheers, Harald van Dijk

Re: When can shells remove "known" process IDs from the list?

2022-04-29 Thread Harald van Dijk via austin-group-l at The Open Group
t introduces another bug. Cheers, Harald van Dijk

Re: [Issue 8 drafts 0001564]: clariy on what (character/byte) strings pattern matching notation should work

2022-04-22 Thread Harald van Dijk via austin-group-l at The Open Group
[accidentally replied privately, re-sending to list] On 22/04/2022 10:54, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 15 Apr 2022: For the most part(*), those shells that support locales appear to already be in agreement that single bytes that do not form

Re: [Issue 8 drafts 0001564]: clariy on what (character/byte) strings pattern matching notation should work

2022-04-18 Thread Harald van Dijk via austin-group-l at The Open Group
On 15/04/2022 04:57, Christoph Anton Mitterer wrote: On Fri, 2022-04-15 at 00:44 +0100, Harald van Dijk via austin-group-l at The Open Group wrote: Hmm, I would. I like that :-D This would have been the preferred alternative I've asked for to look at, in the ticket. Shells

Re: wait and stopped jobs

2022-03-01 Thread Harald van Dijk via austin-group-l at The Open Group
to think carefully about what to do in my shell. Cheers, Harald van Dijk

wait and stopped jobs

2022-02-27 Thread Harald van Dijk via austin-group-l at The Open Group
have this way I am wondering if I am not simply misreading the specification. Am I? If not, does waiting indefinitely match the intent? Cheers, Harald van Dijk

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

2022-01-28 Thread Harald van Dijk via austin-group-l at The Open Group
that not all utilities can process arbitrary binary data. There are many utilities that specify input must be a text file. One way or another it should be made clear whether that is a restriction that also applies to command substitutions. Cheers, Harald van Dijk

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

2022-01-28 Thread Harald van Dijk via austin-group-l at The Open Group
On 28/01/2022 01:48, Christoph Anton Mitterer wrote: 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

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

2022-01-28 Thread Harald van Dijk via austin-group-l at The Open Group
On 28/01/2022 01:49, Christoph Anton Mitterer wrote: 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

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 Harald van Dijk via austin-group-l at The Open Group
nce of one or more bytes representing a single graphic symbol or control code" (3 Definitions), with a note that says it corresponds to what C calls a multi-byte character. Environment variables are not specified to allow arbitrary bytes. Cheers, Harald van Dijk

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
ally store text as wide strings? If so, it would be useful if POSIX were to explicitly require this. yash is written based on the POSIX specification; the fact that they implemented it like this is a clear indication that such a requirement was not clear at all to them. Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001558]: require [^...] in addition to [!...] for bracket expression negation

2022-01-24 Thread Harald van Dijk via austin-group-l at The Open Group
hose allow [^...] but not all of them treat the ^ in it as negation. Whether they treat it as negation is what's relevant, not whether they allow it. Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001440]: Calling `system("-some-tool")` fails (although it is a valid `sh` command)

2021-10-31 Thread Harald van Dijk via austin-group-l at The Open Group
as an operand already means that -c and -- must also be interpreted as operands. Cheers, Harald van Dijk

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 22:54, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open Group" wrote: Either the distinction matters or it doesn't. If it matters, then it was important to switch back to talk about what O?uz wrote. If it does

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 22:14, (Joerg Schilling) wrote: Harald van Dijk wrote: Not correct: ksh93 prints the same as bosh Indeed, something went wrong with the copying there. > and pleasew note that my example is > using an integer format instead of a string format. Irrelevant. You

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 21:34, (Joerg Schilling) wrote: Harald van Dijk wrote: No, it isn't. The second command prints ksh93: c a d zsh: printf: 3: argument specifier out of range c a bosh: c a d Not correct: ksh93 prints the same as bosh Indeed, something went wrong

Re: Adding %n$ conversions to the printf utility (printf(1))

2021-09-10 Thread Harald van Dijk via austin-group-l at The Open Group
On 10/09/2021 20:27, Joerg Schilling via austin-group-l at The Open Group wrote: "O?uz via austin-group-l at The Open Group" wrote: Wouldn't it be more useful if, in printf(1), `n' in `%n$' referred to the nth argument in the current set of arguments being processed? For example, the

Re: shell: swapping var values in one command, plus some here doc stuff

2021-09-08 Thread Harald van Dijk via austin-group-l at The Open Group
aware of in POSIX that allows this. Cheers, Harald van Dijk

Re: shell: swapping var values in one command, plus some here doc stuff

2021-09-03 Thread Harald van Dijk via austin-group-l at The Open Group
tly. That wouldn't be some unexpected interpretation of any POSIX rule, that would simply be a bug. Cheers, Harald van Dijk

Re: $? in a simple command with no command name

2021-09-01 Thread Harald van Dijk via austin-group-l at The Open Group
imes it appears on line 2. Cheers, Harald van Dijk

Re: $? in a simple command with no command name

2021-09-01 Thread Harald van Dijk via austin-group-l at The Open Group
On 01/09/2021 17:22, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 01 Sep 2021: The second problem is the redirection. Based on the above, command substitutions in a redirection are supposed to affect the exit status just as any other command substitution

Re: $? in a simple command with no command name

2021-09-01 Thread Harald van Dijk via austin-group-l at The Open Group
ied order, which looks like a bug (#2) in those shells. This can be confirmed by running under 'set -x'. Bug #1 leads to the output "1 2 1". Bug #2 leads to the output "2 0 0". Bug #1 & bug #2 combined leads to the output "2 0 1". Cheers, Harald van Dijk

Re: utilities and write errors

2021-07-04 Thread Harald van Dijk via austin-group-l at The Open Group
On 04/07/2021 21:54, Robert Elz wrote: Date:Sun, 4 Jul 2021 19:26:25 +0100 From:Harald van Dijk Message-ID: <40fc0b0c-364f-8ff8-0613-a76c887d4...@gigawatt.nl> | P.S.: The fact that the underlying file descriptor of standard output is | fd 1 rathe

Re: utilities and write errors

2021-07-04 Thread Harald van Dijk via austin-group-l at The Open Group
n display and > write in Display. Alternatively, "write" could be defined in a way such that writing to a stream is defined as writing to the file associated with that stream. Cheers, Harald van Dijk P.S.: The fact that the underlying file descriptor of standard output is fd 1 rath

Re: utilities and write errors

2021-06-30 Thread Harald van Dijk via austin-group-l at The Open Group
dent of that, opens /dev/null for writing and immediately closes it, unless this is explicitly made unspecified in some section I have missed. In bash, even in POSIX mode, this runs 'echo hello' with both stdout and stderr redirected to /dev/null. Cheers, Harald van Dijk

Re: execve(2) optimisation for last command

2021-04-15 Thread Harald van Dijk via austin-group-l at The Open Group
specific cases, the optimisation should be perfectly valid and any reasons why it should or should not be performed are not of a technical nature. Cheers, Harald van Dijk

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-13 Thread Harald van Dijk via austin-group-l at The Open Group
On 13/04/2021 14:43, Chet Ramey wrote: On 4/13/21 5:16 AM, Harald van Dijk via austin-group-l at The Open Group wrote: Please note again that POSIX's Command Search and Execution doesn't say "continue until execve() doesn't fail". It says "Otherwise, the command shall be sea

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-13 Thread Harald van Dijk via austin-group-l at The Open Group
On 12/04/2021 21:57, Robert Elz wrote: Date:Mon, 12 Apr 2021 18:42:03 +0100 From:Harald van Dijk Message-ID: | No, not anything. It still has to be shell start-up activity. And your definition of what is a shell start-up activity comes from ? When

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-12 Thread Harald van Dijk via austin-group-l at The Open Group
On 12/04/2021 20:22, (Joerg Schilling) wrote: Harald van Dijk wrote: On 12/04/2021 12:47, (Joerg Schilling) wrote: Do you have a private variant og ksh93v? I get the same behavior from ksh88, the ksh93 from OpenSolaris and ksh93v. I don't. I was testing with ksh built from <ht

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-12 Thread Harald van Dijk via austin-group-l at The Open Group
On 12/04/2021 12:47, (Joerg Schilling) wrote: Harald van Dijk wrote: If they are mistakes, they are widespread mistakes. As hinted in the links, with PATH=/bin:/usr/bin, /bin/gcc and /usr/bin/gcc both existing as files with execute permission, but /bin/gcc as a text file containing #!/bad so

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-12 Thread Harald van Dijk via austin-group-l at The Open Group
On 12/04/2021 00:25, Robert Elz wrote: Date:Sun, 11 Apr 2021 22:27:19 +0100 From:Harald van Dijk Message-ID: <79b98e30-46ba-d468-153f-c1a2a0416...@gigawatt.nl> | Okay, but that is a technicality. The pre-seeding is only permitted at | startu

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 11/04/2021 22:05, Robert Elz wrote: Date:Sun, 11 Apr 2021 19:46:36 +0100 From:Harald van Dijk Message-ID: <9ab286f9-125d-55a4-a65f-08d4af04d...@gigawatt.nl> | Sure, that's why I then switched to a different example that did not | have an e

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
are either seriously deluded, or trolling. I cannot tell which and have no interest in wasting time figuring it out. Cheers, Harald van Dijk

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 11/04/2021 17:50, Robert Elz wrote: Date:Sun, 11 Apr 2021 17:04:05 +0100 From:Harald van Dijk Message-ID: <92113e70-5605-10f4-8e57-47c9f64cd...@gigawatt.nl> | This only applies when a remembered location exists at all, though. Yes, but in the exam

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
: "If the first line of a file of shell commands starts with the characters "#!", the results are unspecified." Cheers, Harald van Dijk

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 11/04/2021 16:33, Robert Elz wrote: Date:Sun, 11 Apr 2021 13:25:46 +0100 From:Harald van Dijk Message-ID: | > My tests show that ksh, bash, yash, mksh do not find gcc in that case. | | Huh. My tests with ksh were with 93v, it's possible differ

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
On 11/04/2021 13:02, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open Group" wrote: If they are mistakes, they are widespread mistakes. As hinted in the links, with PATH=/bin:/usr/bin, /bin/gcc and /usr/bin/gcc both existin

Re: [Shell Command Language][shortcomings of command utlity][improving robustness of POSIX shells]

2021-04-11 Thread Harald van Dijk via austin-group-l at The Open Group
tempt to execute it will fail, there are a lot of shells where command -v gcc returns /bin/gcc, but running gcc actually executes /usr/bin/gcc instead without reporting any error: this behaviour is common to bosh, dash and variants (including mine), ksh, and zsh. Cheers, Harald van Dijk

Re: sh: Assignments to PATH and XCU 2.9.1

2021-03-19 Thread Harald van Dijk via austin-group-l at The Open Group
imisation that dash performs here is not permitted by POSIX. In my shell, a fork of dash, I removed the optimisation for exactly this reason in 2018. Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-22 Thread Harald van Dijk via austin-group-l at The Open Group
On 22/02/2021 13:13, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open Group" wrote: $ bosh -c 'case x in ( (x) echo match ;; esac' bosh: syntax error at line 1: `(' unexpected It may be that you are missinterpreting t

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-22 Thread Harald van Dijk via austin-group-l at The Open Group
g only one of '(' or ')' part of the pattern (now pattern_list) rule for readability reasons, but if you prefer a shorter grammar instead, that makes sense to me too. Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-21 Thread Harald van Dijk via austin-group-l at The Open Group
On 21/02/2021 18:17, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open Group" wrote: On 21/02/2021 17:18, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-21 Thread Harald van Dijk via austin-group-l at The Open Group
On 21/02/2021 17:18, Joerg Schilling via austin-group-l at The Open Group wrote: "Harald van Dijk via austin-group-l at The Open Group" wrote: That is neither what the standard says nor what shells do, though. case x in ( (x) echo match ;; esac is rejected because that firs

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-21 Thread Harald van Dijk via austin-group-l at The Open Group
. Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-19 Thread Harald van Dijk via austin-group-l at The Open Group
On 19/02/2021 17:56, Robert Elz wrote: Date:Fri, 19 Feb 2021 15:11:58 + From:"Harald van Dijk via austin-group-l at The Open Group" Message-ID: <4b4f2cbf-2a2e-f0bf-34ca-a7357f99c...@gigawatt.nl> | Observe that rule 4 is applied fo

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-19 Thread Harald van Dijk via austin-group-l at The Open Group
On 19/02/2021 15:33, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 19 Feb 2021: On 19/02/2021 15:04, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 19 Feb 2021: On 19/02/2021 09:59, Geoff Clare via austin-group-l

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-19 Thread Harald van Dijk via austin-group-l at The Open Group
On 19/02/2021 15:04, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 19 Feb 2021: On 19/02/2021 09:59, Geoff Clare via austin-group-l at The Open Group wrote: How about changing that problem sentence in 2.10.1 to: When a TOKEN is seen where one

Re: [1003.1(2016/18)/Issue7+TC2 0001454]: Conflict between "case" description and grammar

2021-02-19 Thread Harald van Dijk via austin-group-l at The Open Group
invalid and rejected by bash, and when invoked in POSIX mode, also rejected by yash and zsh. Should that become valid, or should that remain an error? (Accidentally sent only to Geoff, re-sending to the list.) Cheers, Harald van Dijk

Re: [1003.1(2008)/Issue 7 0000249]: Add standard support for $'...' in shell

2021-02-06 Thread Harald van Dijk via austin-group-l at The Open Group
as UTF-8, the script will needlessly break when it is run in an ISO-8859-15 environment. Cheers, Harald van Dijk

Re: [1003.1(2016/18)/Issue7+TC2 0001384]: Subshell of an interactive shell is effectively non-interactive

2021-01-11 Thread Harald van Dijk via austin-group-l at The Open Group
so that an effectively non-interactive subshell starts to pretend that it is interactive. Cheers, Harald van Dijk

Re: More issues with pattern matching

2020-08-05 Thread Harald van Dijk via austin-group-l at The Open Group
On 05/08/2020 15:54, Geoff Clare via austin-group-l at The Open Group wrote: Harald van Dijk wrote, on 31 Jul 2020: Take the previous example glibc's cy_GB.UTF-8 locale, but with a different collating element: in this locale, "dd" is a single collating element too. Therefore,

Re: ksh93 job control behaviour [was: Draft suggestion: Job control and subshells]

2020-08-02 Thread Harald van Dijk
On 29/07/2020 16:07, Geoff Clare wrote: Harald van Dijk wrote, on 29 Jul 2020: On 29/07/2020 09:45, Geoff Clare wrote: It's only easy because (most/all?) shells take the easy option and do a lexical analysis of the command to be substituted. trap (without -p) in a command substitution

Re: More issues with pattern matching

2020-08-01 Thread Harald van Dijk
On 31/07/2020 00:10, Harald van Dijk wrote: Take the previous example glibc's cy_GB.UTF-8 locale, but with a different collating element: in this locale, "dd" is a single collating element too. Therefore, this must be matchable by bracket expressions. However, "d" ind

Re: More issues with pattern matching

2020-07-30 Thread Harald van Dijk
yte sequences (byte sequences that lead to EILSEQ) that shells in general try to tolerate, and the shell no longer has the option to decide how to handle invalid patterns (patterns containing non-existent character classes or collating elements) which shells in general also aim to tolerate. Cheers, Harald van Dijk [*] I have not investigated whether implementations actually do do this efficiently.

Re: ksh93 job control behaviour [was: Draft suggestion: Job control and subshells]

2020-07-29 Thread Harald van Dijk
, Harald van Dijk

Re: sh: aliases in command substitutions

2020-04-19 Thread Harald van Dijk
normal, including alias substitution. However, as parsing $(switch foo in foo) by itself results in a syntax error as far as POSIX is concerned, shells are permitted to parse the full $( switch foo in foo) echo ok;; esac ) as a command substitution as an extension instead. All the results you see in shells appear to me to be permitted by the standard. Cheers, Harald van Dijk

Re: XCU 2.14: Exit status by no-argument `return' in shell trap handlers

2020-04-19 Thread Harald van Dijk
On 19/04/2020 14:32, Koichi Murase wrote: 2020-04-19 21:55 Harald van Dijk : My reading was that interpretation B must be what is intended, which is why I had modified my shell, a fork of dash, to change dash's A behaviour to B in late 2018. Thank you. Is your shell this https://github.com

Re: [1003.1(2013)/Issue7+TC1 0000854]: requirement for additional built-in utilities to be searched for via $PATH was not and is not existing practice

2020-03-28 Thread Harald van Dijk
On 28/03/2020 16:31, Robert Elz wrote: Date:Sat, 28 Mar 2020 15:12:48 + From:Harald van Dijk Message-ID: <865ce3c3-9976-9de4-1a65-9aebe80b8...@gigawatt.nl> | Not to disagree with the main point of your message, but printf is | som

Re: [1003.1(2013)/Issue7+TC1 0000854]: requirement for additional built-in utilities to be searched for via $PATH was not and is not existing practice

2020-03-28 Thread Harald van Dijk
of implementing it myself, but it has been used often enough in scripts that sometimes I did feel like taking the easy route and making the scripts use /usr/bin/printf (which on my system is the GNU coreutils version) rather than fixing up the uses to use octal escape sequences. Cheers, Harald van

Re: sed '\n\nnd'

2020-03-25 Thread Harald van Dijk
treats the second \n as . On Wednesday, March 25, 2020 Harald van Dijk wrote: On 25/03/2020 21:09, shwaresyst wrote: > If it wasn't in single quotes, then that might be plausible, but I don't > see it as the int

Re: sed '\n\nnd'

2020-03-25 Thread Harald van Dijk
e standard says or intends to say. On Wednesday, March 25, 2020 Harald van Dijk wrote: On 25/03/2020 19:44, shwaresyst wrote: > The GNU version is more correct, in my opinion, in that the use of n as > a delim

Re: sed '\n\nnd'

2020-03-25 Thread Harald van Dijk
On 25/03/2020 19:44, shwaresyst wrote: The GNU version is more correct, in my opinion, in that the use of n as a delimiter should take precedence over its use as control character alias with the wording as is. The other versions appear to consider the BRE as so does not match 'n'. You have

Re: XCU: 'exit' trap condition

2020-03-15 Thread Harald van Dijk
es match what shells do, and you weren't actually under the impression that the standard required otherwise, if you merely felt the standard could be misinterpreted in such a way, ignore my reply. Cheers, Harald van Dijk

Re: XCU: 'exit' trap condition [was:Re: XCU: 'return' from subshell]

2020-03-15 Thread Harald van Dijk
rminate...". "Before the shell terminates" is not limited to "before the top level shell terminates". If a shell terminates, even if it is a subshell that terminates, any EXIT trap action should be run. Cheers, Harald van Dijk

Re: Weird possibility with async processes, $!, and long running scripts

2020-03-15 Thread Harald van Dijk
at all. The one way I can see that would fix this is to mandate limited support for job ID notation even when job control is disabled, and for scripts to use that instead of tracking PIDs. Cheers, Harald van Dijk

Re: XCU: 'return' from subshell

2020-03-13 Thread Harald van Dijk
On 13/03/2020 13:10, Chet Ramey wrote: On 3/12/20 4:21 PM, Harald van Dijk wrote: On 11/03/2020 17:44, Don Cragun wrote: Would this issue be resolved if we change the last sentence of the description section of the return Special Built-In Utility from: If the shell is not currently

Re: [1003.1(2016)/Issue7+TC2 0001295]: Left brackets in shell patterns may cause other pattern matching characters to be taken literally in all contexts

2019-12-16 Thread Harald van Dijk
On 15/12/2019 12:38, Robert Elz wrote: Date:Sat, 14 Dec 2019 14:41:34 + From:Harald van Dijk Message-ID: <9cbcf0fd-83d1-b449-cfe8-eafdee14b...@gigawatt.nl> | This was not an exhaustive list, nor was it intended to be. Still, if one relies (at all

Re: [1003.1(2016)/Issue7+TC2 0001295]: Left brackets in shell patterns may cause other pattern matching characters to be taken literally in all contexts

2019-12-14 Thread Harald van Dijk
On 14/12/2019 11:29, Robert Elz wrote: Date:Fri, 13 Dec 2019 08:57:28 + From:Harald van Dijk Message-ID: <9c1e4a98-e557-e5d1-27bc-05e7bbfe5...@gigawatt.nl> | Pretending such scripts are portable does a disservice to users. Since the shells yo

Re: [1003.1(2016)/Issue7+TC2 0001295]: Left brackets in shell patterns may cause other pattern matching characters to be taken literally in all contexts

2019-12-13 Thread Harald van Dijk
On 13/12/2019 00:44, Robert Elz wrote: Date:Thu, 12 Dec 2019 21:37:55 + From:Harald van Dijk Message-ID: | This change would benefit not just those shells, but also other existing | shells, The point of the standard isn't to benefit the shells

Re: [1003.1(2016)/Issue7+TC2 0001295]: Left brackets in shell patterns may cause other pattern matching characters to be taken literally in all contexts

2019-12-12 Thread Harald van Dijk
in unclosed bracket expressions, by not requiring re-parsing from the unmatched '['. Cheers, Harald van Dijk

Re: [1003.1(2013)/Issue7+TC1 0000981]: Remove oudated set -o nolog

2019-10-27 Thread Harald van Dijk
, Harald van Dijk

Re: [1003.1(2013)/Issue7+TC1 0000981]: Remove oudated set -o nolog

2019-10-27 Thread Harald van Dijk
On 27/10/2019 17:16, Robert Elz wrote: Date:Sun, 27 Oct 2019 15:44:52 + From:Harald van Dijk Message-ID: <01735f8e-c0ef-a1d6-f8d1-258a669d9...@gigawatt.nl> | This could potentially be useful if the script author knows the command | will be ex

Re: [1003.1(2013)/Issue7+TC1 0000981]: Remove oudated set -o nolog

2019-10-27 Thread Harald van Dijk
ands to be forgotten, including those found through function definitions. Cheers, Harald van Dijk

  1   2   >