[Bug 12776] $@ containing quoted string is split into separate arguments
bugzilla at busybox.net
bugzilla at busybox.net
Thu Apr 16 16:31:27 UTC 2020
https://bugs.busybox.net/show_bug.cgi?id=12776
--- Comment #2 from Marius <marius at psihoexpert.ro> ---
Yes, it works, but I don't understand. Can you explain?
In my view, inside "script.sh 1 2 3", $@ expands into 3 elements:
1 2 3
while "$@" expands inside the quotes creating just one element:
"1 2 3"
So, after it's expanded,
for i in 1 2 3 ; do echo $i ; done
outputs:
1
2
3
and
for i in "1 2 3" ; do echo $i ; done
outputs:
1 2 3
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list