[klibc] [PATCH] klcc: Remove the need for bash

Thorsten Glaser tg at mirbsd.de
Tue Sep 8 13:07:09 PDT 2020


Greg Thelen dixit:

>This doesn't work with older versions of make.  make 4.2.1 seems common
>now and does not support $(shell command).
>
>$ cat Makefile
>$(info take1: $(shell command -v ls))
>$(info take2: $(shell bash -c 'type -p ls'))
>
>all:
>        @true
>
>$ make-3.81/make
>make: command: Command not found

Eh, what?

… checks with gmake 3.81… indeed.

But no, this isn’t correct. You just do this instead:

$(info take1: $(shell sh -c 'command -v ls'))

This works and avoids GNU bash just the same. (I ran this
on a system with no GNU bash installed.)

bye,
//mirabilos, shell maintainer/developer
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh



More information about the klibc mailing list