lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Final redirection of texi output (issue 5650064)


From: David Kastrup
Subject: Re: Final redirection of texi output (issue 5650064)
Date: Tue, 14 Feb 2012 12:27:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

"Phil Holmes" <address@hidden> writes:

> ----- Original Message ----- 
> From: "David Kastrup" <address@hidden>
> To: "Graham Percival" <address@hidden>
> Cc: <address@hidden>; <address@hidden>;
> <address@hidden>; <address@hidden>;
> <address@hidden>
> Sent: Monday, February 13, 2012 11:47 AM
> Subject: Re: Final redirection of texi output (issue 5650064)
>
>
>> Graham Percival <address@hidden> writes:
>>
>>> On Mon, Feb 13, 2012 at 11:05:56AM +0000, address@hidden wrote:
>>>>
>>>> scripts/build/run-and-check.sh:2: eval $1 > $2 2>&1
>>>>
>>>> Actually, it is totally basic shell scripting here.
>>>
>>> Well, apparently you don't need "basic" shell scripting for 7
>>> years of full-time linux use and 4 years of macosx use, and
>>> thousands of hours of open-source work for multiple projects.
>>> I've called programs, I've used for loops, but anything fancier
>>> than that is done as a makefile or python.
>>>
>>> My rule of thumb is that if I don't understand something easily,
>>> then at least 50% of future lilypond contributors won't understand
>>> it either.
>>
>> eval is ugly and a little-travelled corner, and it might be necessary to
>> write
>>
>> eval "$1" > "$2" 2>&1
>>
>> instead, though the amount of quoting required for working with shell
>> internals varies and I don't remember in all too fine detail.  The $1
>> quite likely wants quotes, the $2 will possibly do without.
>
> In this instance, it doesn't appear to need that.

If any kind of quotes or wildcards are passed to the shell function, you
likely don't want them interpreted twice and/or prematurely.  Typical
candidates would be calling the shell function with something like
"cd xxx; echo *"
in which case you don't want to have * expanded before the cd is
executed.

If you create a shell function instead of a Makefile macro, it should do
what it is written for not just when called from inside of the Makefile.

If $1 happens to contain an absolute path in its contents, it is the
whim of the user creating the directory just how many metacharacters
will appear in it.

> If problems do arise, I'll try to remember the suggestion.

Good luck.

> I'm not trying to reduce complexity - rather to make "make doc"
> produce less output.

If you want to record one thing, but execute another, something like

        @echo x
        @x-with-lots-of-garbage

may be an option.  Of course, it might make it harder to reproduce the
last action causing a problem.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]