On 9/6/2012 12:55 AM, Ulrich Mueller wrote:
On Thu, 06 Sep 2012, Gregory M Turner wrote:
Several correct-ish solutions exist, i.e., in the above we could change
the concatenation statement to read:

EROOT="${ROOT}${EPREFIX#/}"

I'd rather do it the other way around:
EROOT=${ROOT%/}${EPREFIX}

Reason: EPREFIX is guaranteed to start with a slash, whereas for ROOT
I wouldn't be so sure that it always ends with one.

Good point, but EPREFIX is empty for non-prefix gentoo.  So, I guess:

EROOT="${ROOT%/}/${EPREFIX#/}"

It's a contrived example anyhow, so it's mostly academic.

My main concern is the correct behavior when ROOT is defined, but empty -- I mostly included this explanation to preempt anyone inclined to ask "what are you trying to achieve?" :P

-gmt


Reply via email to