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

Bug#973852: Debootstrap with mirror_style 'main' fails



On Fri, 6 Nov 2020 at 15:59, David <bouncingcats@gmail.com> wrote:
> On Fri, 6 Nov 2020 at 13:20, Tim Connors <tim.connors@ranchosoquel.net> wrote:

> > at line 911.  The cause is line 885 in the same function
> >
> >      for p in "$@"; do
> >
> > The double quotes cause the list of packages to be seen as a
> > single item.
>
> No, in that statement, they don't. $@ behaves like an array.
> Its elements are separate items. As shown:
>
> [david@kablamm ~]$ dash
> $ set 1 2 3 4 5
> $ printf '%s\n' "$@"
> 1
> 2
> 3
> 4
> 5
> $ for e in "$@" ; do printf '%s\n' "$e" ; done
> 1
> 2
> 3
> 4
> 5
> $
>
> > The for loop iterates only once with the value of p containing
> > the entire space-separated list of packages.

Re-reading, I realised that my second example there does not
really demonstrate (because of how printf behaves as shown
in the first example) that the 'for' loop iterates more than once.

So here is a clearer demo that the 'for' loop runs 5 times:

$ set 1 2 3 4 5
$ for e in "$@" ; do t="$t$e," ; done ; printf '%s\n' "$t"
1,2,3,4,5,


Reply to: