Re: bash 5.1 heredoc pipes problematic, shopt needed

2022-05-02 Thread Jesse Hathaway
On Mon, May 2, 2022 at 9:53 AM Chet Ramey wrote: > My preference is a portable memfd_create(); I think I could get around > its limitations. I'm sure you can google with the best of them, but I did come across this project which did some work trying to create a portable version of memfd_create(),

Re: Building loadable builtin

2022-04-14 Thread Jesse Hathaway
On Thu, Apr 14, 2022 at 11:52 AM Robert E. Griffith wrote: > Question 3: what is the best practice for maintaining loadable builtins? > Can anyone suggest an existing loadable builtin project that I could > model mine after? I don't have too much advice on best practices, but I did write a blog p

Re: "trap" output from "if" statement redirected wrongly

2022-04-13 Thread Jesse Hathaway
On Wed, Apr 13, 2022 at 7:59 AM Frank Heckenbach wrote: > This script writes "foo" to bar rather than stdout as I'd expect. > > It's triggered by the "if" statement (which doesn't even cause > running in a subshell, so it's not that). > > #!/bin/bash > set -e > trap 'echo foo' 0 > #false > bar #

Re: Squiggly heredoc - new feature request

2021-08-31 Thread Jesse Hathaway
On Tue, Aug 31, 2021 at 2:24 AM Přemysl Šťastný wrote: > > Thanks for advice. How do you use it in more detail please? You can feed shfmt an individual file to format, it defaults to using tabs for indentation: $ shfmt ~/test.sh #!/bin/bash cat <<-EOF hello! EOF Or you can instru

Re: Squiggly heredoc - new feature request

2021-08-30 Thread Jesse Hathaway
> Will ksh93 version ever get to upstream? This ugly 'bug' is here for > decades and really irritates me and many people, who ever used shell for > larger scripting and don't like to use tabs. I used to always prefer spaces, until I switched to auto formatting all my Bash scripts with shfmt[1]. It

Re: Prefer non-gender specific pronouns

2021-06-07 Thread Jesse Hathaway
On Sun, Jun 6, 2021 at 10:28 AM Greg Wooledge wrote: > Out of these 5 choices, the one that seems to suck the *least*, according > to observed usage patterns in current written and spoken English, is > "they". I agree with Greg, *they* has become the dominant gender neutral pronoun in English. I

Re: zsh style associative array assignment bug

2021-04-05 Thread Jesse Hathaway
On Mon, Mar 29, 2021 at 4:18 PM Chet Ramey wrote: > If you look at > > a=( k1 v1 k2 v2 k3 v3) > > as more or less syntactic sugar for > > a=( [k1]=v1 [k2]=v2 [k3]=v3 ) > > it's reasonable that > > a=( k1 v1 k2 ) > > is equivalent to > > a=( [k1]=v1 [k2]= ). And that's what bash does. This equival

Re: Changing the way bash expands associative array subscripts

2021-03-17 Thread Jesse Hathaway
I would welcome this change, I struggled today with trying to increment an associative array in an arithmetic context. I think this change would make for much better ergonomics when working with associative arrays. Yours kindly, Jesse Hathaway

Re: Feature Request: Python-like string split and join

2021-01-24 Thread Jesse Hathaway
On Sat, Jan 23, 2021 at 11:17 PM William Park wrote: > I'm running out of special characters, and I don't want another operator > or syntax that I can't remember 2 weeks from now. :-) That's my main > issue with Zsh. I concur, I find the expansion operators devilishly hard to remember!

Re: Bash-5.1-beta available

2020-09-11 Thread Jesse Hathaway
On Fri, Sep 11, 2020 at 5:40 AM Andreas Schwab wrote: > The reason for using a process substitution is so that the loop can set > shell variables. Would using lastpipe be an option instead? lastpipe If set, and job control is not active, the shell runs

Re: Procsub.tests on OSes using named pipes

2020-02-14 Thread Jesse Hathaway
> An easy way to reproduce it is to launch a script with: " moo() { echo > "ok";}; moo >(true)", you'll see an "ok" in your bash terminal and a > subprocess will be blocked in an open syscall. The fact that we are seeing > this "ok" means that the output of the parent process was never redirected t