From owner-freebsd-questions@FreeBSD.ORG Thu Aug 21 10:44:47 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C0E1065672 for ; Thu, 21 Aug 2008 10:44:47 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 54BC78FC0A for ; Thu, 21 Aug 2008 10:44:47 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KW7en-0001PP-MG for freebsd-questions@freebsd.org; Thu, 21 Aug 2008 10:44:45 +0000 Received: from 35.red-80-34-206.staticip.rima-tde.net ([80.34.206.35]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Aug 2008 10:44:45 +0000 Received: from matiassurdi by 35.red-80-34-206.staticip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 21 Aug 2008 10:44:45 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Matias Surdi Date: Thu, 21 Aug 2008 12:47:01 +0200 Lines: 43 Message-ID: References: <200808211039.m7LAdnhk092337@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 35.red-80-34-206.staticip.rima-tde.net User-Agent: Thunderbird 2.0.0.16 (X11/20080724) In-Reply-To: <200808211039.m7LAdnhk092337@lurza.secnetix.de> Sender: news Subject: Re: [OT] Evaluate strings in bash X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Aug 2008 10:44:47 -0000 Oliver Fromme escribió: > Matias Surdi wrote: > > Oliver Fromme escribió: > > > Matias Surdi wrote: > > > > Oliver Fromme escribió: > > > > > 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` > > > > > > > > I've already tried that, but doesn't work. > > > > > > It does work. Maybe you forgot the "echo" part? > > > > Maybe I've not explained it very well, look here: > > http://www.linuxquestions.org/questions/linux-general-1/bash-strings-evaluation-664094/ > > You have explained it well enough, I think, and the > solution I explained above works fine. If it doesn't > work for you, then you did it wrong. The solution > written at the URL you mentioned is unnecessarily > complicated. > > $ 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 > $ newvariable=`eval echo $BINMAKE` > $ echo $newvariable > make -m /usr/src/share/mk > $ > > Best regards > Oliver > You are right, this works fine also.I've forgot the "echo". Thanks for your help.