[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Assignment of $* to a var removes spaces on unset IFS.
From: |
Bize Ma |
Subject: |
Assignment of $* to a var removes spaces on unset IFS. |
Date: |
Mon, 13 Aug 2018 11:51:08 -0400 |
Executing this code:
set -- " foo " " bar baz " " quux "
unset IFS
a=$*
b="$*"
printf '[%s]' "$a" "$b"; echo
Leads to this results in several shells:
ash : [ foo bar baz quux ][ foo bar baz
quux ]
dash : [ foo bar baz quux ][ foo bar baz
quux ]
b205sh : [ foo bar baz quux ][ foo bar baz
quux ]
b30sh : [ foo bar baz quux ][ foo bar baz
quux ]
b32sh : [ foo bar baz quux ][ foo bar baz
quux ]
b41sh : [ foo bar baz quux ][ foo bar baz
quux ]
b42sh : [ foo bar baz quux ][ foo bar baz
quux ]
b43sh : [foo bar baz quux][ foo bar baz quux ]
b44sh : [foo bar baz quux][ foo bar baz quux ]
bash : [foo bar baz quux][ foo bar baz quux ]
posixbash : [foo bar baz quux][ foo bar baz quux ]
lksh : [ foo bar baz quux ][ foo bar baz
quux ]
mksh : [ foo bar baz quux ][ foo bar baz
quux ]
ksh93 : [ foo bar baz quux ][ foo bar baz
quux ]
attsh : [ foo bar baz quux ][ foo bar baz
quux ]
zsh : [ foo bar baz quux ][ foo bar baz
quux ]
Bash since 4.3 fails to follow what the documentation describes as that on
an assignment
values do not undergo splitting or globing.
- Assignment of $* to a var removes spaces on unset IFS.,
Bize Ma <=
- Re: Assignment of $* to a var removes spaces on unset IFS., Robert Elz, 2018/08/13
- Re: Assignment of $* to a var removes spaces on unset IFS., Eduardo Bustamante, 2018/08/13
- Re: Assignment of $* to a var removes spaces on unset IFS., Bize Ma, 2018/08/13
- Re: Assignment of $* to a var removes spaces on unset IFS., Eduardo A . Bustamante López, 2018/08/13
- Re: Assignment of $* to a var removes spaces on unset IFS., Bize Ma, 2018/08/13
- Re: Assignment of $* to a var removes spaces on unset IFS., Eduardo A . Bustamante López, 2018/08/13
- Re: Assignment of $* to a var removes spaces on unset IFS., Pierre Gaston, 2018/08/14
- Re: Assignment of $* to a var removes spaces on unset IFS., Bize Ma, 2018/08/14
- Re: Assignment of $* to a var removes spaces on unset IFS., Chet Ramey, 2018/08/15
- Re: Assignment of $* to a var removes spaces on unset IFS., Greg Wooledge, 2018/08/14