From c50b9100a14622a038cf0841963eeec7011f845a Mon Sep 17 00:00:00 2001 From: Jakub Jirutka Date: Wed, 11 Oct 2017 20:39:00 +0200 Subject: [PATCH] Fix incorrect usage of $@ "$@" works differently on ash and dash. `foo="$@"` assigns only the first item (according to IFS) to the variable on dash. --- alpine-make-vm-image | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine-make-vm-image b/alpine-make-vm-image index adf678b..274856c 100755 --- a/alpine-make-vm-image +++ b/alpine-make-vm-image @@ -199,7 +199,7 @@ prepare_chroot() { # root of the image. rc_add() { local runlevel="$1"; shift # runlevel name - local services="$@" # names of services + local services="$*" # names of services local svc; for svc in $services; do mkdir -p etc/runlevels/$runlevel @@ -413,10 +413,10 @@ if [ -n "$SCRIPT" ]; then script_name="${SCRIPT##*/}" if [ "$SCRIPT_CHROOT" = 'no' ]; then - einfo "Executing script: $script_name $@" + einfo "Executing script: $script_name $*" "$SCRIPT" "$@" || die 'Script failed' else - einfo "Executing script in chroot: $script_name $@" + einfo "Executing script in chroot: $script_name $*" mount --bind "${SCRIPT%/*}" mnt/ chroot . sh -c "cd /mnt && ./$script_name \"\$@\"" -- "$@" \ || die 'Script failed'