[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openembedded-core
Subject:    [OE-core] [PATCH] rootfs_rpm: Escape the backtick to ensure the ls runs on the target
From:       sgw () linux ! intel ! com (Saul Wold)
Date:       2013-01-30 18:35:23
Message-ID: 510967EB.5060700 () linux ! intel ! com
[Download RAW message or body]

On 01/30/2013 02:13 AM, Enrico Scholz wrote:
> 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.
>
Yes, I verified the out put in the S98run-postinsts script that is on 
disk and it's correct.

There a line above that sets i=\$i so the expansion occurs back to $i!

Sau!

> E.g. compare
>
> i=abc
>
> cat << "EOF"
> echo $i
> EOF
>
> cat << EOF
> echo $i
> EOF
>
>
> Enrico
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic