bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

$*, and $IFS, again


From: Steffen Nurpmeso
Subject: $*, and $IFS, again
Date: Fri, 14 Mar 2025 01:34:48 +0100
User-agent: s-nail v14.9.25-641-gce53683382-dirty

Hello again.

I am deeply sorry, but i have one more difficulty that i fail to
explain to myself.  It *could* (small, very small case) be that
this time the incorrectness really is on the side of bash.
This script (do not care for the commented, they are great)

  a() {
    echo $#,1="$1"/$1,2="$2"/$2,3="$3"/$3,4="$4"
    echo $#,'*'="$*"/$*,
  }
  set -- '' 'a' ''
  #IFS=\ ; echo "$*"$* $*; a "$*"$* $*;unset IFS
  #IFS= ; echo "$*"$* $*; a "$*"$* $*;unset IFS
  IFS=:; echo "$*"$* $*; a "$*"$* $*;unset IFS

outputs

  :a: a  a
  4,1=:a:/ a ,2=a/a,3=/,4=a
  4,*=:a::a::a/ a  a  a,

I have a problem  ^  with this space character of bash.
My MUA outputs

  4,*=:a::a::a/ a a  a,$

instead for this case.  I find this logical since before the
resplit we have ":a:" + "a" + "" + "a", and the trailing ":" in
the first only delimits the field of "a", so the next field will
not join, causing the echo(1) argument to be separated by a space
character.  But no other space i see.

Thanks, and a good night from Germany i wish,

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]