Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-22 Thread Greg Wooledge
On Fri, Mar 22, 2024 at 02:09:23PM -0400, Lawrence Velázquez wrote: > On Fri, Mar 22, 2024, at 12:54 PM, Greg Wooledge wrote: > > Also, I don't see the lower-case k transformation in the man page. > > It's at the end of the list: > >

feat: exit 1 "file not found"

2024-03-22 Thread teknopaul
Hi not sure if this is the correct forum... exit builtin accepts one and only one arg currently. Would it be backwards compatible and generally useful to support echoing a reason for exiting? test -f file || exit 2 "file not found" good bash scripters handle and report errors have seen lots

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-22 Thread Lawrence Velázquez
On Fri, Mar 22, 2024, at 12:54 PM, Greg Wooledge wrote: > Also, I don't see the lower-case k transformation in the man page. It's at the end of the list: https://git.savannah.gnu.org/cgit/bash.git/tree/doc/bash.1?id=f3b6bd1#n3525 -- vq

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-22 Thread Greg Wooledge
On Fri, Mar 22, 2024 at 11:23:35AM -0400, Chet Ramey wrote: > This is what you can do with @K. > > https://lists.gnu.org/archive/html/bug-bash/2021-08/msg00119.html > > Word splitting doesn't happen on the rhs of an assignment statement, so you > use eval. The @K quoting is eval-safe. It would

Re: Bash printf should diagnose integer overflow

2024-03-22 Thread Chet Ramey
On 3/22/24 2:40 AM, Paul Eggert wrote: $ diff -u :check[34].log --- :check3.log    2024-03-21 14:09:48.069094929 -0700 +++ :check4.log    2024-03-21 22:39:51.391869014 -0700 @@ -327,6 +327,10 @@  warning: UNIX versions number signals and schedule processes differently.  warning: If output

Re: "${assoc[@]@k}" doesn't get expanded to separate words within compound assignment syntax

2024-03-22 Thread Chet Ramey
On 3/20/24 10:16 AM, Zachary Santer wrote: and then uses eval in his examples of how Bash could incorporate similar behavior: array=( val1 "val2*[special-chars]" ) printf -v serialized "%q " "${array[@]}" eval "deserialized=($serialized)" declare-A hash=( [key1]=val1

Re: Bash printf should diagnose integer overflow

2024-03-22 Thread Paul Eggert
On 2024-03-21 13:31, Chet Ramey wrote: Interesting. I can't reproduce this. Using the commit to which your patches apply, without applying any of them, on a fresh Virtualbox Fedora 39 install, I get consistent `make tests' output every time. I just now tried the latest devel commit

Re: Debian bug #822605: SIGPIPE not handled in "echo >", terminates shell

2024-03-22 Thread Gioele Barabucci
On 21/03/24 22:54, Chet Ramey wrote: On 3/21/24 1:43 PM, Gioele Barabucci wrote: On 21/03/24 18:08, Oğuz wrote: On Thu, Mar 21, 2024 at 7:13 PM Gioele Barabucci wrote: Regardless of the reason for the SIGPIPE, the reporter expects the loop to carry on indefinitely (`while true; ...`). Then