lilypond-devel
[Top][All Lists]
Advanced

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

Re: echo but return false in make


From: David Kastrup
Subject: Re: echo but return false in make
Date: Fri, 17 Jun 2011 21:20:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Graham Percival <address@hidden> writes:

> On Fri, Jun 17, 2011 at 02:18:55PM -0400, Julien Rioux wrote:
>> On 17/06/2011 2:11 PM, Graham Percival wrote:
>> >Again, on the shell, it would be something like this:
>> >  make ...blah... || echo "build failed" && tail logfile
>> >but there might be a nicer way to do it.
>> 
>> but then when blah fails, make will not stop, since the return
>> status from echo && tail is a success (assuming the log file
>> exists). How would you return failure and force make to stop?
>
> Interesting, I hadn't considered that.  Hmm, is there such a thing
> as functions in bach?

Bash, you mean.  Basically
myfun() { this && that; return 0; }

> If so, it would be easy to return something after doing the echo.

Hm?  You can just write

make ...blah... || { echo "build failed" && tail logfile; exit 1; }

> Of course, we can't guaranteed that bash will be present... does
> sh(1) allow functions?

Like above, it does.

-- 
David Kastrup




reply via email to

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