[OT] Evaluate strings in bash

Chuck Swiger cswiger at mac.com
Wed Aug 20 17:27:08 UTC 2008


On Aug 20, 2008, at 9:31 AM, Matias Surdi wrote:
> I've the following variable:
>
> [code]
> # echo $BINMAKE
> `if [ -x /usr/obj/usr/src/make.i386/make ]; then echo /usr/obj/usr/ 
> src/make.i386/make; else echo make; fi` -m /usr/src/share/mk
> #
> [/code]
>
> It's a string wich includes a commmand.
>
> How can I get the subcommand replaced by its output?

I think you're looking for "eval $BINMAKE"...?

-- 
-Chuck



More information about the freebsd-questions mailing list