Richard Melville wrote:
On 11 June 2017 at 17:06, Bruce Dubbs <[email protected]

    $() is specific to bash.  We try to keep the boot scripts Bourne Shell
    compatible.  I agree that $() is generally preferable, but not here.


Bruce, thanks for your answer.  I wasn't going to reply as it seems a
little like nit-picking, but, as {,B}LFS is primarily an educational
resource, I felt that your statement needed correcting, for the benefit of
newcomers.  They would be led to believe that they could not use $() for
any shell other than bash, but $() isn't a construct that's "specific to
bash". AFAIK all modern shells can use that command substitution
construct.  Indeed, bash borrowed the construct from the Korn shell is the
first place.  I can understand your desire for backwards compatibility,
but "Bourne Shell compatible" seems to me to be taking things a little too
far.  Besides, the $() construct is Posix compatible.

OK, my mistake.  I didn't test it.  In dash 'echo $(ls)' does work.

Learned something today.

There are 38 instances of using `command` in the boot scripts. I do not know if it is worthwhile changing them or not. The scripts have been working pretty well since LFS 7.0 in 2011.

  -- Bruce


--
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to