[OE-core] [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Wed Jan 30 10:13:14 UTC 2013


Saul Wold <sgw-VuQAYsv1563Yd54FQh9/CA at public.gmane.org> writes:

> This change ensures that the ls /etc/rpm-postinsts runs in the target
> at first boot time, rather than at the creation time of the script on
> the host.
> ...
> -for i in `ls /etc/rpm-postinsts/`; do
> +for i in \`ls /etc/rpm-postinsts/\`; do
>  	i=/etc/rpm-postinsts/$i
>  	echo "Running postinst $i..."

are you really sure, this is enough? $i gets probably expanded too.  A
better way than to escape all and everything is to quote the EOF marker.

E.g. compare

i=abc

cat << "EOF"
echo $i
EOF

cat << EOF
echo $i
EOF


Enrico




More information about the Openembedded-core mailing list