Closed grmhskidata closed 2 months ago
In the Docker entrypoint script, the $BASH_SOURCE variable is referenced: https://github.com/docker-library/rabbitmq/blob/444c58b5b51433019a9422737ee98b05adcf7e06/4.0/alpine/docker-entrypoint.sh#L10
$BASH_SOURCE
According to the documentation (https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-BASH_005fSOURCE), BASH_SOURCE is an array, and expanding an array without an index only gives the first element, see https://www.shellcheck.net/wiki/SC2128. Depending on what is desired for that command, the expansion of BASH_SOURCE should be improved to either reference the first element (i.e., ${BASH_SOURCE[0]}) or to expand the entire array (i.e., ${BASH_SOURCE[@]}).
${BASH_SOURCE[0]}
${BASH_SOURCE[@]}
The intention is the first element (this is intentional). Thanks for checking, though!
But in that case, "${BASH_SOURCE[0]}" would make the intention clear and avoid possible confusion.
In the Docker entrypoint script, the
$BASH_SOURCE
variable is referenced: https://github.com/docker-library/rabbitmq/blob/444c58b5b51433019a9422737ee98b05adcf7e06/4.0/alpine/docker-entrypoint.sh#L10According to the documentation (https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-BASH_005fSOURCE), BASH_SOURCE is an array, and expanding an array without an index only gives the first element, see https://www.shellcheck.net/wiki/SC2128. Depending on what is desired for that command, the expansion of BASH_SOURCE should be improved to either reference the first element (i.e.,
${BASH_SOURCE[0]}
) or to expand the entire array (i.e.,${BASH_SOURCE[@]}
).