[Omake] SVN Commit: OMake Build System (Rev. 8888)

Aleksey Nogin nogin at cs.caltech.edu
Wed Mar 15 15:01:37 PST 2006


On 15.03.2006 14:43, Jason Hickey wrote:

> [Sorry about the previous null spam]
> 
> Aleksey Nogin wrote:
> 
>> But do you still allow passing full command lines in regular 
>> variables? I want to be able to do things like
>>
>> pipeline{text, where) =
>>    echo $(text) $(where)
>>
>> pipeline(foo, > /tmp/foo)
>> pipeline(bar, | sendmail bar)
> 
> 
> I see your point.  On the other hand, there is something to be said for 
> knowing the structure of a pipeline just by looking at it statically.
> 
> In any case, if we do this, then we have to decide what to do with shell 
> operators in arrays.
> 
> These two should probably be different.
> 
>    X[] =
>       echo
>       > /dev/null
> 
>    Y[] =
>       echo
>       >
>       /dev/null
> 
> Options are:
>    1. [super-relaxed] Allow array elements to be split (very bad IMO)
>    2. [relaxed] Array elements are quoted wrt shell operators
>    3. [strict] Commands are effectively parsed statically

4. [relaxed, with checking] The $X is a syntax error.
5. Strict (3) by default, but with a function that would provide the 
"relaxed with checking" semantics.

Now that I think about it some more, may be the relaxed semantics is the 
way to go. In that case it becomes kind of weird to still allow unquoted 
globbing in arrays (since everything else is quoted) - may be arrays in 
command lines should indeed just stay completely quoted. Consider the 
following in perl:

% perl -e 'system("echo","*");'
*
% perl -e 'system("echo *");'
...files...

-- 
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin at cs.caltech.edu (office), aleksey at nogin.org (personal)
Office: Moore 04, tel: (626) 395-2200


More information about the OMake-Devel mailing list