Re: Man page section for complete's -C option is inconsistent

2022-07-06 Thread Mark Chandler via Bug reports for the GNU Bourne Again SHell
Yep. It's definitely clear if you read the 'Programmable Completion' section. A brief reference to the 'Programmable Completion' section to get that explanation would be useful. Or some hint that further reading is required to understand the functionality of this option. As it stands the exp

Re: documentation string for caller builtin

2022-07-06 Thread Ernest Adrogué
2022-07- 6, 09:48 (-0400); Chet Ramey escriu: > > Hello, > > > > The documentation string for the 'caller' builtin command in bash.pot > > appears to be incomplete, in particular the last 4 lines from the > > snippet below which were present in previous versions are now missing: > > Not so. > >

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-06 Thread Steffen Nurpmeso
Andreas Schwab wrote in <87czeiqhb2@igel.home>: |On Jul 06 2022, Steffen Nurpmeso wrote: | |> $ bash -c 'I=10; echo $((1++I)); echo $I' |> bash: line 1: 1++I: syntax error in expression (error token is "++I") |> $ bash -c 'I=10; echo $((1++1)); echo $I' |> 10 |> |> $ bash -c

Re: $(( )): binary/unary VAR/NUM inconsistency

2022-07-06 Thread Andreas Schwab
On Jul 06 2022, Steffen Nurpmeso wrote: > $ bash -c 'I=10; echo $((1++I)); echo $I' > bash: line 1: 1++I: syntax error in expression (error token is "++I") > $ bash -c 'I=10; echo $((1++1)); echo $I' > 10 > > $ bash -c 'I=10;echo "<$(( +10+++I ))>"' > <21> A C compiler would parse all

$(( )): binary/unary VAR/NUM inconsistency

2022-07-06 Thread Steffen Nurpmeso
Hello. 'Struggling with a Dijkstra two stack parser i am thankful to be able to compare against bash that uses a completely different and correct parser! I stumbled upon this (bash 5.1.16); i find it "understandable" in respect to clarity, but inconsistent, and also in hindsight to the announceme

Re: local -p outputs invalid declare -- -

2022-07-06 Thread Chet Ramey
On 7/1/22 1:16 AM, Emanuele Torre wrote: > Bash Version: 5.1 > Patch Level: 16 > Release Status: release > > Description: > `local -p' (and also `declare -p'/`typeset -p') outputs > "declare -- -" when used in a function that has declared > `local -'. > > `declare -' (a

Re: Man page section for complete's -C option is inconsistent

2022-07-06 Thread Chet Ramey
On 7/4/22 12:03 AM, Mark Chandler via Bug reports for the GNU Bourne Again SHell wrote: > Configuration Information [Automatically generated, do not change]: > Machine: x86_64 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -O2 -flto=auto -ffat-lto-objects -fexceptions -g > -grecord-gcc-switc

Re: Revisiting Error handling (errexit)

2022-07-06 Thread Yair Lenga
Koichi - Thanks for highlighting this 'local -'. This feature effectively eliminates the need to support scoped 'errfail'. If it's needed in a limited context, the 'local -' can be used. Yair On Wed, Jul 6, 2022 at 1:21 PM Koichi Murase wrote: > 2022年7月6日(水) 19:05 Yair Lenga : > > Function fo

Re: documentation string for caller builtin

2022-07-06 Thread Chet Ramey
On 7/2/22 6:09 AM, Ernest Adrogué wrote: > Hello, > > The documentation string for the 'caller' builtin command in bash.pot > appears to be incomplete, in particular the last 4 lines from the > snippet below which were present in previous versions are now missing: Not so. #: builtins.c:369 msgid

Re: Warning raised if trying to set LC_ALL to a locale bearing a character type other than UTF-8 and C

2022-07-06 Thread Chet Ramey
On 7/1/22 9:08 AM, Kerin Millar wrote: > Hello, > > I was experimenting with locale variables in bash and noticed something that > appears odd. This is with bash 5.1.16 and glibc 2.35. > > $ locale -a | grep -E '^en_(US|GB)' > en_GB.utf8 > en_US > en_US.iso88591 > en_US.utf8 > > $ locale > LANG

Re: Feature request

2022-07-06 Thread Andreas Schwab
On Jul 06 2022, Brad Hayes wrote: > Perhaps something similar to PHP's __DIR__ and __FILE__ constants? You can get that from $0. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."

Re: Feature request

2022-07-06 Thread Greg Wooledge
On Wed, Jul 06, 2022 at 01:25:38PM +1000, Brad Hayes wrote: > source "$__DIR/file.ext" #$__DIR == the absolute path to the current > scripts location. https://mywiki.wooledge.org/BashFAQ/028

Re: Feature request

2022-07-06 Thread Martin Schulte
Hello Brad! > It would be fantastic if there was a nicer way to source files from the > same folder instead of copy-pasting complicated logic in every script. I'm not sure if I understand your questions correctly, but did you try source "${0%/*}/file.ext" ? >- my sourceables also need logi

Feature request

2022-07-06 Thread Brad Hayes
Hey, guys I just joined to ask this please forgive me if I am in the wrong place. First of all big fan of bash, I use it a LOT 🚀. It would be fantastic if there was a nicer way to source files from the same folder instead of copy-pasting complicated logic in every script. Perhaps something si

Re: Revisiting Error handling (errexit)

2022-07-06 Thread Koichi Murase
2022年7月6日(水) 19:05 Yair Lenga : > Function foo will run with errfail logic. But bash will revert back to no > errfail when control revert back to bar, and zap will run WITHOUT errfail. > I remember reading about other bash setting that are automatically restored > on function exits. Can not remembe

Re: Revisiting Error handling (errexit)

2022-07-06 Thread Koichi Murase
2022年7月6日(水) 18:04 Martin D Kealey : > Perhaps > > function -E funcname { … } FWIW, an existing syntax for the "per-function set -o functrace / set -T" is like function funcname { ... } declare -ft funcname# Note: -ft is a combination of two options -f and -t -- Koichi

Re: Revisiting Error handling (errexit)

2022-07-06 Thread Yair Lenga
Hi. Thanks for proposal. For my use case, where I have large existing code base, where I want to improve error checking, and avoid unhandled errors, per function setting will not work. This will also deviate from the try ... Catch pattern used in many other scripting solution, making it hard for d

Re: Revisiting Error handling (errexit)

2022-07-06 Thread Martin D Kealey
Modules can have conflicting requirements of global settings that require weird contortions to interoperate; so starting out by making this yet another global setting seems like a retrograde step. So I would like to propose an alternative approach. Firstly, I would reduce the action to simply "re

Re: Revisiting Error handling (errexit)

2022-07-06 Thread Robert Elz
Date:Wed, 6 Jul 2022 01:34:53 +0300 From:Yair Lenga Message-ID: <6b7e3c85-5fcd-459e-a41c-e2803b0e7...@gmail.com> | Function main () { | Local x. # x is local | For x in a b ; do process $x ; done | } | | Vs. | # x is global, all function will