Re: Shell Grammar man page function definition

2021-02-28 Thread Dale R. Worley
Mike Jonkmans writes: > Some examples that work: > function x { :; } ## as expected > function x if :; then :; fi > function x (( 42 )) > function x [[ 42 ]] > function x for x do :; done > function x for (( ; 42 - 42 ; )); do :; done > > What does not work: >

Re: is it normal that set -x unset commands dont display special chars in the content

2021-02-28 Thread Chet Ramey
On 2/28/21 6:19 PM, k...@plushkava.net wrote: The check for shell special characters, which results in single quoting, comes before whether there are any characters that would require ANSI-C quoting. This is not specific to unset. In fairness, I don't think it's strictly incorrect to say that

Re: is it normal that set -x unset commands dont display special chars in the content

2021-02-28 Thread
On 28/02/2021 22:47, Chet Ramey wrote: On 2/28/21 5:32 PM, k...@plushkava.net wrote: On 28/02/2021 22:13, Chet Ramey wrote: On 2/27/21 6:14 AM, Alex fxmbsw7 Ratchev wrote: but they get unset right, just doesnt display em i have stuff with $'\34' separator and in set -x output the text is jus

Re: is it normal that set -x unset commands dont display special chars in the content

2021-02-28 Thread Chet Ramey
On 2/28/21 5:32 PM, k...@plushkava.net wrote: On 28/02/2021 22:13, Chet Ramey wrote: On 2/27/21 6:14 AM, Alex fxmbsw7 Ratchev wrote: but they get unset right, just doesnt display em i have stuff with $'\34' separator and in set -x output the text is just flat for the unset + unset 'dat[kwmete

Re: is it normal that set -x unset commands dont display special chars in the content

2021-02-28 Thread
On 28/02/2021 22:13, Chet Ramey wrote: On 2/27/21 6:14 AM, Alex fxmbsw7 Ratchev wrote: but they get unset right, just doesnt display em i have stuff with $'\34' separator and in set -x output the text is just flat for the unset + unset 'dat[kwmetest]' 'dat[1kw1]' 'dat[1take]' 'dat[1code]' cod

Re: [PATCH] Fix history deletion when using negative offsets (from the end)

2021-02-28 Thread Chet Ramey
On 2/26/21 4:38 PM, Christopher Gurnee wrote: I would assume that this is implied by "start-end". I agree with you, and I think the documentation is fine. I was just pointing out that specifying an invalid start/end element results in an error and an exit status of 1, but specifying an invali

Re: is it normal that set -x unset commands dont display special chars in the content

2021-02-28 Thread L A Walsh
On 2021/02/28 14:13, Chet Ramey wrote: On 2/27/21 6:14 AM, Alex fxmbsw7 Ratchev wrote: These code fragments have nothing to do with each other. Why not include a self-contained example that includes relevant `stuff' in what you're passing to `unset'? cuz he's trollin us?

Re: is it normal that set -x unset commands dont display special chars in the content

2021-02-28 Thread Chet Ramey
On 2/27/21 6:14 AM, Alex fxmbsw7 Ratchev wrote: but they get unset right, just doesnt display em i have stuff with $'\34' separator and in set -x output the text is just flat for the unset + unset 'dat[kwmetest]' 'dat[1kw1]' 'dat[1take]' 'dat[1code]' code includes minuskws_p1=$nspace$SUBSEP$m

Re: Shell Grammar man page function definition

2021-02-28 Thread Chet Ramey
On 2/28/21 12:38 PM, Mike Jonkmans wrote: The manual page says: If the function reserved word is used, but the parentheses are not supplied, the braces are required. That text has been there since the earliest versions of the man page. It's not strictly true any more, but it's

Re: Shell Grammar man page function definition

2021-02-28 Thread Oğuz
28 Şubat 2021 Pazar tarihinde Mike Jonkmans yazdı: > Hi, > > The manual page says: > If the function reserved word is used, but the parentheses are not > supplied, > the braces are required. > > But it seems that from all the compound commands, > only a subshell is not possible. >

Re: Shell Grammar man page function definition

2021-02-28 Thread Greg Wooledge
Mike Jonkmans (bash...@jonkmans.nl) wrote: > What does not work: > function x ( : ) The parser is looking for () after the function name. Most likely, the opening ( is confusing it. unicorn:~$ bash unicorn:~$ x() ( : ) unicorn:~$ function y() ( : ) unicorn:~$ type x x is a function x () {

Shell Grammar man page function definition

2021-02-28 Thread Mike Jonkmans
Hi, The manual page says: If the function reserved word is used, but the parentheses are not supplied, the braces are required. But it seems that from all the compound commands, only a subshell is not possible. Some examples that work: function x { :; } ## as expected