From owner-freebsd-questions@FreeBSD.ORG Mon Feb 15 12:10:12 2010 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 8EC99106566C for ; Mon, 15 Feb 2010 12:10:12 +0000 (UTC) (envelope-from eray.aslan@caf.com.tr) Received: from mail.caf.com.tr (mail.caf.com.tr [88.250.85.68]) by mx1.freebsd.org (Postfix) with ESMTP id 099428FC12 for ; Mon, 15 Feb 2010 12:10:11 +0000 (UTC) Received: from localhost (sunny.caf.com.tr [127.0.0.1]) by mail.caf.com.tr (Postfix) with ESMTP id 0D7BD39E371 for ; Mon, 15 Feb 2010 12:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=caf.com.tr; h= content-transfer-encoding:content-type:content-type:in-reply-to :references:subject:subject:mime-version:user-agent:from:from :date:date:message-id:received:received; s=originating; t= 1266235808; bh=5iH2NUj1qfDXTAvY8t082tlRhcaWCeUVEvM8nJgFUFE=; b=P NbtSSu2xhKpsQgLRuDY/8M2+iJG30ERX29xQ74G65p1eSrWDBDWCmNNBrwwpOT4u vR3eB4M1im5e8ARdzoyfFGTd+WNnYQyqkUKUcI2/jLYSu+coC+jszdrMYA8eK9V0 uKbO7jeVdRZPuM5OKGi0lsHTt/lhCnh7VOLycxr8n4= X-Virus-Scanned: amavisd-new at caf.com.tr Received: from mail.caf.com.tr ([127.0.0.1]) by localhost (sunny.caf.com.tr [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id rVOzUdv9HR1i for ; Mon, 15 Feb 2010 12:10:08 +0000 (UTC) Received: from [10.0.0.11] (unknown [10.0.0.11]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eray.aslan@zeplin.net) by mail.caf.com.tr (Postfix) with ESMTPSA id 1CAA139E361 for ; Mon, 15 Feb 2010 12:10:08 +0000 (UTC) Message-ID: <4B7939A0.6020102@caf.com.tr> Date: Mon, 15 Feb 2010 14:10:08 +0200 From: Eray Aslan User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <560f92641002142207w7eade79fr6a4f40ae5b92f4b9@mail.gmail.com> <4B78EFCC.2010102@caf.com.tr> <560f92641002142321s246f15fcg6f233b0c152e1d6a@mail.gmail.com> In-Reply-To: <560f92641002142321s246f15fcg6f233b0c152e1d6a@mail.gmail.com> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: simple (and stupid) shell scripting question 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: Mon, 15 Feb 2010 12:10:12 -0000 On 15.02.2010 09:21, Nerius Landys wrote: > But in the case where you're assigning the output of ls directly to a > variable like this: > > FOO=`ls` > > vs > > FOO="`ls`" > > the text assigned to FOO is the same, right? Apparently, it is: sh-4.0$ touch "x *" sh-4.0$ FOO=`ls`;echo "$FOO"|od 0000000 020170 005052 0000004 sh-4.0$ BAR="`ls`"; echo "$BAR"|od 0000000 020170 005052 0000004 There might be some corner cases tho. Test before puting into production (newlines/control chars in file names, different versions of shell, different set/shopt options, changes in IFS etc). -- Eray