Hello Robert.
Thanks again for your extensive answers.
Robert Elz wrote in
<2675.1726728...@jacaranda.noi.kre.to>:
|Date:Thu, 19 Sep 2024 00:45:44 +0200
|From:Steffen Nurpmeso
|Message-ID: <20240918224544.aXWgbZu-@steffen%sdaoden.eu>
|
|| Woops. I did not know
On 9/19/24 2:42 AM, Robert Elz wrote:
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
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 '}'
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
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 --
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
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
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
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
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
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
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 print
0.
Hello.
I am terribly sorry to be here once again; i already mentioned on
bug-bash@ the problem with IFS being reverse solidus that dash
(and myself) has (have).
I came back to this for my one again, and i stumble over one
additional difference in behaviour in between (myself and) bash,
dash and bu
Dear Robert, i am totally distracted regarding this topic.
I will carefully read it and the standard again.
(We also have likely the last midsommer week here, and i am out
whenever i can.)
Thanks for taking the time to look that deeply into this issue.
Robert Elz wrote in
<12813.1724902...@jacara
On 8/28/24 11:41 PM, Robert Elz wrote:
The reason all this is messy, is that it is (more or less) the
way it was implemented in the original Bourne shell. That tells
you that the implementation must be simple - the rules might seem
complex to explain, but the implementation is sure to be simpl
Date:Wed, 28 Aug 2024 02:03:54 +0200
From:Steffen Nurpmeso
Message-ID: <20240828000354.qZaQvm7v@steffen%sdaoden.eu>
| That confuses me again, unfortunately i got a bug report and
| distracted. I mean, i would
|
| 1. skip leading whitespace anyhow (IFS or not,
Robert Elz wrote in
<14146.1724799...@jacaranda.noi.kre.to>:
|Date:Tue, 27 Aug 2024 22:02:34 +0200
|From:Steffen Nurpmeso
|Message-ID: <20240827200234.95X76_wN@steffen%sdaoden.eu>
|
|
|| Any character in IFS delimits a field, adjacent IFS whitespace
|| char
Date:Tue, 27 Aug 2024 22:02:34 +0200
From:Steffen Nurpmeso
Message-ID: <20240827200234.95X76_wN@steffen%sdaoden.eu>
| Any character in IFS delimits a field, adjacent IFS whitespace
| characters are then ignored.
Not quite. Any sequence of any amount of IFS
Chet Ramey wrote in
:
|On 8/26/24 8:21 PM, Steffen Nurpmeso wrote:
|> Chet Ramey wrote in
|> :
|>|On 8/23/24 5:47 PM, Steffen Nurpmeso wrote:
|>|> If IFS has a value other than the default, then sequences of the
|>|> whitespace characters space, tab, and newline are ignored at the
|>|
On 8/26/24 8:21 PM, Steffen Nurpmeso wrote:
Chet Ramey wrote in
:
|On 8/23/24 5:47 PM, Steffen Nurpmeso wrote:
|> If IFS has a value other than the default, then sequences of the
|> whitespace characters space, tab, and newline are ignored at the
|> beginning and end of the word,
Lawrence Velázquez wrote in
<972ac206-a601-4337-8dfc-77bbaef22...@app.fastmail.com>:
|On Sat, Aug 24, 2024, at 10:08 PM, Steffen Nurpmeso wrote:
|> One hopefully last thing in this regard for me,
...
|This easily obfuscates the structure of the "$@" expansion. You'd
|be better off with somet
alex xmb sw ratchev wrote in
:
|try
|
|${@@Q}
|
|and
|
|${*@Q}
|
|greets
I try to avoid using non-portable shell stuff.
I do not think these would be understood by the ash shell variants
(and ksh) which had results other than bash.
--steffen
|
|Der Kragenbaer,The moon be
Chet Ramey wrote in
:
|On 8/23/24 5:47 PM, Steffen Nurpmeso wrote:
|> If IFS has a value other than the default, then sequences of the
|> whitespace characters space, tab, and newline are ignored at the
|> beginning and end of the word, as long as the whitespace
|> character is in the
Dear Robert, all.
Robert Elz wrote in
<39.1724620...@jacaranda.noi.kre.to>:
|Date:Sun, 25 Aug 2024 04:08:58 +0200
|From:Steffen Nurpmeso
|Message-ID: <20240825020858.nrX4pFTm@steffen%sdaoden.eu>
|
|| (The only thinkable answer is that the step that my MUA does,
try
${@@Q}
and
${*@Q}
greets
On Wed, Aug 14, 2024, 2:45 AM Steffen Nurpmeso wrote:
> Hello.
>
> I include bug-bash even though i think bash is correct, but there
> lots of people of expertise are listening, so, thus.
> Sorry for cross-posting, nonetheless.
> Given this snippet (twox() withou
On 8/24/24 11:49 PM, Lawrence Velázquez wrote:
The bash manual says [1]:
*
($*) Expands to the positional parameters, starting
from one. When the expansion is not within double
quotes, each positional parameter expands to a
On 8/23/24 5:47 PM, Steffen Nurpmeso wrote:
If IFS has a value other than the default, then sequences of the
whitespace characters space, tab, and newline are ignored at the
beginning and end of the word, as long as the whitespace
character is in the value of IFS (an IFS whitespace cha
Date:Sun, 25 Aug 2024 04:08:58 +0200
From:Steffen Nurpmeso
Message-ID: <20240825020858.nrX4pFTm@steffen%sdaoden.eu>
| (The only thinkable answer is that the step that my MUA does,
| namely resolving $* as a single string first, does not happen,
| right?
That's
On Sat, Aug 24, 2024, at 11:49 PM, Lawrence Velázquez wrote:
> Correct. Since you're using $* unquoted in a context where field
> splitting is performed, the shell does not expand it to a single
> field.
That is, unless there's a single positional parameter that is not
further split.
--
vq
On Sat, Aug 24, 2024, at 10:08 PM, Steffen Nurpmeso wrote:
> One hopefully last thing in this regard for me,
>
> c() { echo "$# 1<$1> 2<$2> 3<$3> *<$*> @<$@>"; }
This easily obfuscates the structure of the "$@" expansion. You'd
be better off with something like this, which prints each positiona
Robert Elz wrote in
<26326.1724474...@jacaranda.noi.kre.to>:
|Date:Fri, 23 Aug 2024 23:47:06 +0200
|From:Steffen Nurpmeso
|Message-ID: <20240823214706.oskn9OEF@steffen%sdaoden.eu>
|
|| So IFS whitespace only if part of $IFS.
|
|That is the definition of IFS whi
Greg Wooledge wrote in
:
|On Sat, Aug 24, 2024 at 02:15:48 +0200, Steffen Nurpmeso wrote:
|> a() {
|> echo $#,1=$1,2=$2,"$*",$*,
|>}
|
|You didn't read a word I said, did you
I recognize that i did not get your email even though i was in Cc:.
|*Sigh.*
--End of
--steffen
|
|De
Emanuele Torre wrote in
:
|On Sat, Aug 24, 2024 at 02:15:48AM +0200, Steffen Nurpmeso wrote:
|> Sorry but i really have to come again, i do not understand what is
|> going on, and *i* think shell is at fault.
|
|No. It is working correctly.
|
|> This:
|>
|> a() {
|> echo $#,1=$1,2
Steffen Nurpmeso wrote in
<20240825013311.B3Z3QcNn@steffen%sdaoden.eu>:
|Robert Elz wrote in
| <26326.1724474...@jacaranda.noi.kre.to>:
||Date:Fri, 23 Aug 2024 23:47:06 +0200
||From:Steffen Nurpmeso
||Message-ID: <20240823214706.oskn9OEF@steffen%sdaoden.eu>
||
Date:Sat, 24 Aug 2024 02:33:26 +0200
From:Emanuele Torre
Message-ID:
| No. It is working correctly.
It is indeed.
| This $1 is unquoted, it will be split. You need to use "$1" if you don't
| want it to split.
Alternatively, make a() be
a()
{
Date:Fri, 23 Aug 2024 23:47:06 +0200
From:Steffen Nurpmeso
Message-ID: <20240823214706.oskn9OEF@steffen%sdaoden.eu>
| So IFS whitespace only if part of $IFS.
That is the definition of IFS whitespace.
| So this "adjacent" even if *not* part of $IFS.
No, only cha
On Sat, Aug 24, 2024 at 02:15:48 +0200, Steffen Nurpmeso wrote:
> a() {
> echo $#,1=$1,2=$2,"$*",$*,
> }
You didn't read a word I said, did you
*Sigh.*
On Sat, Aug 24, 2024 at 02:15:48AM +0200, Steffen Nurpmeso wrote:
> Sorry but i really have to come again, i do not understand what is
> going on, and *i* think shell is at fault.
No. It is working correctly.
>
> This:
>
> a() {
> echo $#,1=$1,2=$2,"$*",$*,
This $1 is unquoted, it will b
Sorry but i really have to come again, i do not understand what is
going on, and *i* think shell is at fault.
This:
a() {
echo $#,1=$1,2=$2,"$*",$*,
}
echo "$*"$* $*; a "$*"$* $*
echo __
IFS=:;echo "$*"$* $*; a "$*"$* $*;unset IFS
echo ==
set -- a b c
echo "$*"$* $*; a "$*"$*
Greg Wooledge wrote in
:
|On Fri, Aug 23, 2024 at 01:28:49 +0200, Steffen Nurpmeso wrote:
|> a() { echo $#,1=$1,2=$2,"$*",$*,; }
|> set -- a b c
|> echo 2
|> IFS=:; echo "$*"$*; a $* "$*";
I want to point out that bash in particular has the very dubious
description in its manual page
On Fri, Aug 23, 2024 at 01:28:49 +0200, Steffen Nurpmeso wrote:
> a() { echo $#,1=$1,2=$2,"$*",$*,; }
> set -- a b c
> echo 2
> IFS=:; echo "$*"$*; a $* "$*";
Your printing function "a" is highly questionable. It's got unquoted
word expansions that'll do who knows what, and it's also usin
Hello.
Sorry for being here again, rather bash unrelated mostly..
Steffen Nurpmeso wrote in
<20240816215210.PMy3rwiy@steffen%sdaoden.eu>:
|Steffen Nurpmeso wrote in
| <20240816212216.accse4FG@steffen%sdaoden.eu>:
||Robert Elz wrote in
|| <16443.1723841...@jacaranda.noi.kre.to>:
|||Date:
Steffen Nurpmeso wrote in
<20240816212216.accse4FG@steffen%sdaoden.eu>:
|Hello kre@.
|
|Robert Elz wrote in
| <16443.1723841...@jacaranda.noi.kre.to>:
||Date:Thu, 15 Aug 2024 23:33:42 +0200
||From:Steffen Nurpmeso
||Message-ID: <20240815213342.t6-hdjZT@steffen%
Hello kre@.
Robert Elz wrote in
<16443.1723841...@jacaranda.noi.kre.to>:
|Date:Thu, 15 Aug 2024 23:33:42 +0200
|From:Steffen Nurpmeso
|Message-ID: <20240815213342.t6-hdjZT@steffen%sdaoden.eu>
|
|| I have extended the test a bit, and i also see word split
|| dif
Date:Thu, 15 Aug 2024 23:33:42 +0200
From:Steffen Nurpmeso
Message-ID: <20240815213342.t6-hdjZT@steffen%sdaoden.eu>
| I have extended the test a bit, and i also see word split
| differences.
There are so many problems with this test, that I'm not sure
it is worth
One more, please.
(And please excuse this still copies bug-bash.)
Steffen Nurpmeso wrote in
<20240815184858.r5T_UQnM@steffen%sdaoden.eu>:
|Steffen Nurpmeso wrote in
| <20240814200534.Vh3Eu_Md@steffen%sdaoden.eu>:
||Chet Ramey wrote in
|| <1bba673e-5ab9-4263-9d88-124854793...@case.edu>:
|||On
Hello.
Unfortunately i have to add one thing to this thread..
Steffen Nurpmeso wrote in
<20240814200534.Vh3Eu_Md@steffen%sdaoden.eu>:
|Chet Ramey wrote in
| <1bba673e-5ab9-4263-9d88-124854793...@case.edu>:
||On 8/13/24 8:45 PM, Steffen Nurpmeso wrote:
||> I include bug-bash even though i thi
On Wed, Aug 14, 2024 at 09:23:49AM -0400, Greg Wooledge wrote:
> The most obvious would be to treat "$@$@" as if it were "$@" "$@",
> generating exactly two words for each positional parameter.
>
>
Thanks for this. My two cents:
if I want "$@" "$@", i write it litterally. "$@$@" kinda
Hello.
I only respond to this to reduce the noise.
Chet Ramey wrote in
<1bba673e-5ab9-4263-9d88-124854793...@case.edu>:
|On 8/13/24 8:45 PM, Steffen Nurpmeso wrote:
|> I include bug-bash even though i think bash is correct, but there
|> lots of people of expertise are listening, so, thus.
|>
On 8/13/24 8:45 PM, Steffen Nurpmeso wrote:
Hello.
I include bug-bash even though i think bash is correct, but there
lots of people of expertise are listening, so, thus.
Sorry for cross-posting, nonetheless.
Given this snippet (twox() without argument it is)
one() { echo "$# 1<$1>"; }
two
On Wed, Aug 14, 2024 at 17:58:15 +0300, Oğuz wrote:
> On Wed, Aug 14, 2024 at 5:23 PM Robert Elz wrote:
> > However, as ksh93 makes "" from this
> > expansion, and so probably ksh88 might have done as well
>
> No, both Sun and SCO variants expand "$@$@" to zero fields when $# is 0.
HP-UX 10.20 a
On Wed, Aug 14, 2024 at 5:23 PM Robert Elz wrote:
> However, as ksh93 makes "" from this
> expansion, and so probably ksh88 might have done as well
No, both Sun and SCO variants expand "$@$@" to zero fields when $# is 0.
Date:Wed, 14 Aug 2024 09:23:49 -0400
From:Greg Wooledge
Message-ID:
| The most obvious would be to treat "$@$@" as if it were "$@" "$@",
That would clearly be wrong when there are positional parameters.
| As a human trying to read this expression and figure out
Date:Wed, 14 Aug 2024 11:04:08 +0200
From:Marc Chantreux
Message-ID:
| I'm really currious: do you see another one ?
The case he was asking about is when $# is 0 (no positional params set)
and whether "$@$@" should result in "" (1 arg) or nothing (0 args).
Upon r
On Wed, Aug 14, 2024 at 11:04:08 +0200, Marc Chantreux wrote:
> > We know what "$@" is supposed to do. And something like "x${@}y" is
> > well-defined also -- you simply prefix "x" to the first word, and append
> > "y" to the final word.
>
> > But I don't know how "$@$@" is supposed to be interpr
> We know what "$@" is supposed to do. And something like "x${@}y" is
> well-defined also -- you simply prefix "x" to the first word, and append
> "y" to the final word.
> But I don't know how "$@$@" is supposed to be interpreted. I do not see
> anything in the official wording that explains how
On Wednesday, August 14, 2024, Steffen Nurpmeso wrote:
>
> one() { echo "$# 1<$1>"; }
> two() { one "$@"; }
> twox() { one "$@$@"; }
> two
> two x
> twox
> twox x
> $ dash shbug.sh
> 0 1<>
> 1 1
> 1 1<>
> 1 1
> #?0|kent:tmp$ bash shbug.sh
> 0 1<>
> 1 1
> 0 1<>
On Wed, Aug 14, 2024 at 02:45:25 +0200, Steffen Nurpmeso wrote:
> I include bug-bash even though i think bash is correct, but there
> lots of people of expertise are listening, so, thus.
> Sorry for cross-posting, nonetheless.
> Given this snippet (twox() without argument it is)
>
> one() { echo
On Wed, Aug 14, 2024, 02:45 Steffen Nurpmeso wrote:
> Hello.
>
> I include bug-bash even though i think bash is correct, but there
> lots of people of expertise are listening, so, thus.
> Sorry for cross-posting, nonetheless.
> Given this snippet (twox() without argument it is)
>
> one() { echo
Hello.
I include bug-bash even though i think bash is correct, but there
lots of people of expertise are listening, so, thus.
Sorry for cross-posting, nonetheless.
Given this snippet (twox() without argument it is)
one() { echo "$# 1<$1>"; }
two() { one "$@"; }
twox() { one "$@$@"; }
two
60 matches
Mail list logo