Boost logo

Boost-Build :

Subject: Re: [Boost-build] Unexpected line feed when capturing shell output
From: Martin Dyring-Andersen (mda_at_[hidden])
Date: 2015-09-19 17:49:30


Thanks Brian,

> Maybe try:
> local MY_LOCAL = [ SHELL "echo -n test" ] ;

Of course now it seems I oversimplified my example. :-) I want to capture current git branch using this:

local GIT_BRANCH = [ SHELL "git rev-parse --abbrev-ref HEAD" ] ;
echo "before$(GIT_BRANCH)after" ;

It seems my shell fu skills are lacking, a quick Google turns up "tr" or "awk" examples.. Any suggestions what would be the cleanest way to achieve my goal?

BR,
Martin


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