confused by for loop
zffocussss opened this issue · comments
for version; do
....
done
can some guys tell me how this block work,as version is not a array variables.
That is shorthand for the following:
for version in "$@"; do
i.e. looping over the args to the script. When the args list is empty in this script, it is set by the eval "set -- $versions"
of this block:
Lines 16 to 19 in 164603c
it is so interesting,can you please give me a link to this syntax,as I never used/known about it.
what is this meaning ? ${dir////-}
for dir; do
base="busybox:${dir////-}"
done
it is so interesting,can you please give me a link to this syntax,as I never used/known about it.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_03
what is this meaning ? ${dir////-}
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion (specifically, ${parameter//pattern/string}
- replace all /
with -
)
it is so interesting,can you please give me a link to this syntax,as I never used/known about it.
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_03
what is this meaning ? ${dir////-}
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html#Shell-Parameter-Expansion (specifically,
${parameter//pattern/string}
- replace all/
with-
)
it do work,thanks @tianon