[OT] Evaluate strings in bash

Oliver Fromme olli at lurza.secnetix.de
Wed Aug 20 17:25:02 UTC 2008


Matias Surdi wrote:
 > # 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
 > 
 > I'd like to have a second variable like:
 > [code]
 > # echo $newvariable
 > make -m /usr/src/share/mk

# newvariable=`eval echo $BINMAKE`

By the way, this has nothing to do with bash.  Those things
work with every bourne shell, including FreeBSD's /bin/sh.
It even works with Solaris' /bin/sh which is very far from
a POSIX shell.  :-)

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"C++ is the only current language making COBOL look good."
        -- Bertrand Meyer


More information about the freebsd-questions mailing list