Re: improving '{...}' in bash?

2024-07-23 Thread Harald Dunkel
On 2024-07-23 11:10:23, Martin D Kealey wrote: On Tue, 23 Jul 2024, 15:50 Harald Dunkel, wrote: Hi folks, This feels weird: Did you read the manual before trying any of these? Of course not. I just wanted to say, this {...} construct is rather unintuitive to use. I know how to write

improving '{...}' in bash?

2024-07-22 Thread Harald Dunkel
Hi folks, This feels weird: % echo x{1,2}x x1x x2x % echo x{1}x x{1}x % echo x{1..3,5}x x1..3x x5x I would have expected "x1x" and "x1x x2x x3x x5x". Regards Harri

5.1 regression?

2022-08-01 Thread Harald Dunkel
Hi folks, a colleague pointed me to a changed behavior of bash 5.1.4 in Debian 11. Would you mind to take a look at this code? #! /bin/bash # set -x insert() { local data="$1" local lineNumber="$2" head -n "$lineNumber" echo ' ' cat <<< "$data" echo ' ' cat } t

Re: unbalanced parenthesis not recognized

2021-11-22 Thread Harald Dunkel
Hi Chet, On 2021-11-19 16:27:34, Chet Ramey wrote: On 11/19/21 2:02 AM, Harald Dunkel wrote: "Some scenarios" is the point here. The parenthesis have to balance as soon as it comes to shell parameter expansion, which is (or should have been) the case here. OK. Let's look

Re: unbalanced parenthesis not recognized

2021-11-18 Thread Harald Dunkel
On 2021-11-18 17:52:29, Robert Elz wrote: Date:Thu, 18 Nov 2021 10:34:40 +0100 From:Harald Dunkel Message-ID: | at least due to unbalanced parenthesis? Greg's reply was correct, but he didn't explicitly address that point. In sh, chara

unbalanced parenthesis not recognized

2021-11-18 Thread Harald Dunkel
Hi folks, I am not sure, but shouldn't bash 5.1.4 complain about : ${SSLDIR}:="${JM_WORK}/ssl"} at least due to unbalanced parenthesis? The correct version would be : ${SSLDIR:="${JM_WORK}/ssl"} Regards Harri

weird behavior of set -e

2011-06-24 Thread Harald Dunkel
Hi folks, A colleague pointed me to this problem: If I run ( set -e; ( false; echo x ) ) in bash 4.1.5, then there is no screen output, as expected. If I change this to ( set -e; ( false; echo x ) || echo y ) then I get "x" instead of "y". How comes? Any helpful comment would