Boost logo

Boost-Build :

Subject: Re: [Boost-build] string manipulation
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2016-10-13 16:24:36


On 13.10.2016 16:11, aaron_at_[hidden] wrote:
> Have a look at the docs here:
> http://www.boost.org/build/doc/html/jam/language.html#jam.language.variables
>
> > Specifically, I have a variable that captures the output of an external
> > tool I have executed. How can I strip off the trailing newline from that
> > when I assign that to another variable ?
>
> The SHELL rule has an optional parameter that will automatically strip
> off the trailing newline
> (this is not documented).
>
>
> Use it like this:
>
> local output = [ SHELL path/to/tool.py : strip-eol ] ;
>
> And the newline will automatically be stripped.

Thanks, that works. How can I capture errors using the SHELL command,
i.e. handle cases where `path/to/tool.py`either returns an error or
writes to stderr (or both) ?

Thanks,
        Stefan

-- 
      ...ich hab' noch einen Koffer in Berlin...

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk