On Wed, 12 Mar 2014, Sven Schreiber wrote:
Am 12.03.2014 17:13, schrieb Allin Cottrell:
> On Thu, 13 Mar 2014, yinung at Gmail wrote:
>>
>> It seems that setinfo with a string @sInfo will not allow any space in that
>> string.
>
> If the string contains spaces it must be quoted:
>
> setinfo y -d "@sInfo"
>
Although Yi-Nung does have a point in that it is a bit unfortunate that
the syntactical correctness of the line:
'setinfo y -d @sInfo'
is ambiguous, depending on the content of sInfo. I understand why that
it so, but still...
That would be a valid objection if setinfo took a string variable as an
argument, and the correctness depended on whether or not the value of that
variable contained spaces. But as things are setinfo requires a string
literal. The "@..." syntax just dumps a string literal into the command
line, and as usual a string containing spaces must be quoted to keep the
pieces stuck together.
In general, there's no telling whether @-substitution will yield a
syntactically correct command unless you know the expansion of the "@"
term. This is in itself a potential problem, but it's the price paid for
the flexibility that string substitution gives.
Allin