Set environment variable on remote target
Jie Zhang
jie.zhang@analog.com
Thu Jul 17 11:28:00 GMT 2008
Andreas Schwab wrote:
> Jie Zhang <jie.zhang@analog.com> writes:
>
>> Andreas Schwab wrote:
>>> Jie Zhang <jie.zhang@analog.com> writes:
>>>
>>>> @@ -261,7 +262,11 @@ proc rsh_exec { boardname program pargs inp outp } {
>>>> set inp "/dev/null"
>>>> }
>>>> - set ret [local_exec "$RSH $rsh_useropts $hostname sh -c '$program
>>>> $pargs \\; echo XYZ\\\${?}ZYX'" $inp $outp $timeout]
>>>> + set remote_envs ""
>>>> + foreach envvar [array names remote_env] {
>>>> + set remote_envs "$remote_envs $envvar=$remote_env($envvar)"
>>> That needs to do proper quoting to protect shell meta characters.
>>>
>> Thanks for pointing out this. A new patch is attached. Is the quoting right?
>
> That won't protect all meta characters. Inside double quotes the dollar
> sign, backslash and backquote are still special.
>
So we have to use single quotes. The updated patch is attached.
Thanks,
Jie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dejagnu-remote-env-3.diff
Type: text/x-patch
Size: 1217 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20080717/1529d7a7/attachment.bin>
More information about the Gcc
mailing list