Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Robert Elz
Date:Thu, 19 Sep 2024 00:45:44 +0200 From:Steffen Nurpmeso Message-ID: <20240918224544.aXWgbZu-@steffen%sdaoden.eu> | Woops. I did not know that, i always separate {} at the beginning | an the end, yet not (). '(' and ')' (parentheses) are operators, '{' and '}'

Re: printf inconsistent results for %.0f

2024-09-18 Thread Stephane Chazelas
2024-08-14 09:11:05 -0400, Chet Ramey: > On 8/13/24 7:05 PM, Grisha Levit wrote: > > On Mon, Aug 12, 2024, 11:04 Chet Ramey > > wrote: > > > > My question is why the (admittedly old) gnulib replacement > > strtod/strtold > > is messing things up. > > > > > >

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Steffen Nurpmeso
Robert Elz wrote in <5996.1726697...@jacaranda.noi.kre.to>: |Date:Wed, 18 Sep 2024 23:05:06 +0200 |From:Steffen Nurpmeso |Message-ID: <20240918210506.9rRUe2TG@steffen%sdaoden.eu> | || I am totally surprised they all swallow this code, there is no || separating w

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Robert Elz
Date:Wed, 18 Sep 2024 23:05:06 +0200 From:Steffen Nurpmeso Message-ID: <20240918210506.9rRUe2TG@steffen%sdaoden.eu> | I am totally surprised they all swallow this code, there is no | separating whitespace in between the ; and the } which closes the | function --

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Steffen Nurpmeso
Chet Ramey wrote in : |On 9/18/24 1:05 AM, Oğuz wrote: |> On Wed, Sep 18, 2024 at 4:19 AM Steffen Nurpmeso \ |> wrote: |> It boils down to this: |> |>f(){ echo $#;}; set "" "" ""; IFS=x; f $* |> |> bash, NetBSD and FreeBSD sh, and ksh88 all agree and print 2. pdksh |> prints 3 but

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Steffen Nurpmeso
Robert Elz wrote in <3946.1726671...@jacaranda.noi.kre.to>: ... || On Wed, Sep 18, 2024 at 08:05:10 +0300, Oğuz wrote: ||> It boils down to this: ||> f(){ echo $#;}; set "" "" ""; IFS=x; f $* | ||> bash, NetBSD and FreeBSD sh, and ksh88 all agree and print 2. pdksh ||> prints 3 but mksh

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Steffen Nurpmeso
Oğuz wrote in : |On Wed, Sep 18, 2024 at 4:19 AM Steffen Nurpmeso \ |wrote: |> | |It boils down to this: In this case, ok .. i have not spent time trying to vaporise it. I haved added this standalone thing to my tests. | f(){ echo $#;}; set "" "" ""; IFS=x; f $* | |bash, NetBSD and Fre

Re: Suggested BASH Improvement

2024-09-18 Thread Chet Ramey
On 9/18/24 1:10 PM, Greg Wooledge wrote: Thanks for the proposal. I think the [base#]n syntax is reasonable here without adding a new shell option. Do recall, however, that negative numbers break the workaround suggested by Andreas. $((10#${line:12:2})) Not part of the original problem

Re: Suggested BASH Improvement

2024-09-18 Thread Greg Wooledge
On Wed, Sep 18, 2024 at 10:51:51 -0400, Chet Ramey wrote: > On 9/17/24 7:50 PM, BRUCE FOWLER via Bug reports for the GNU Bourne Again > SHell wrote: > > An interesting problem I ran into recently: > > I have a shell script that I run about once a month that > > "screen-scrapes" from the output of a

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Robert Elz
Date:Wed, 18 Sep 2024 07:21:30 -0400 From:Greg Wooledge Message-ID: | On Wed, Sep 18, 2024 at 08:05:10 +0300, Oğuz wrote: | > It boils down to this: | > f(){ echo $#;}; set "" "" ""; IFS=x; f $* | > bash, NetBSD and FreeBSD sh, and ksh88 all agree and pri

Re: Suggested BASH Improvement

2024-09-18 Thread Chet Ramey
On 9/17/24 7:50 PM, BRUCE FOWLER via Bug reports for the GNU Bourne Again SHell wrote: An interesting problem I ran into recently: I have a shell script that I run about once a month that "screen-scrapes" from the output of another program using the substring capability, e.g. ${data_line:12:2

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Chet Ramey
On 9/18/24 1:05 AM, Oğuz wrote: On Wed, Sep 18, 2024 at 4:19 AM Steffen Nurpmeso wrote: It boils down to this: f(){ echo $#;}; set "" "" ""; IFS=x; f $* bash, NetBSD and FreeBSD sh, and ksh88 all agree and print 2. pdksh prints 3 but mksh and oksh print 1. dash, ksh93, yash, and zsh pri

Re: Question on $IFS related differences (Was: Question on $@ vs $@$@)

2024-09-18 Thread Greg Wooledge
On Wed, Sep 18, 2024 at 08:05:10 +0300, Oğuz wrote: > On Wed, Sep 18, 2024 at 4:19 AM Steffen Nurpmeso wrote: > > > > It boils down to this: > > f(){ echo $#;}; set "" "" ""; IFS=x; f $* > > bash, NetBSD and FreeBSD sh, and ksh88 all agree and print 2. pdksh > prints 3 but mksh and oksh print

Re: Suggested BASH Improvement

2024-09-18 Thread Andreas Schwab
On Sep 17 2024, BRUCE FOWLER via Bug reports for the GNU Bourne Again SHell wrote: > of C-language compatibility. I could use the [base#]n form > but that gets awkward. Why is that awkward? It's a general solution to a general problem, and does not require any new features. > Even the venerabl