From owner-freebsd-questions@FreeBSD.ORG Mon Feb 15 07:21:22 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 6DD121065670 for ; Mon, 15 Feb 2010 07:21:22 +0000 (UTC) (envelope-from nlandys@gmail.com) Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.25]) by mx1.freebsd.org (Postfix) with ESMTP id 290078FC1B for ; Mon, 15 Feb 2010 07:21:21 +0000 (UTC) Received: by qw-out-2122.google.com with SMTP id 8so382646qwh.7 for ; Sun, 14 Feb 2010 23:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=JdzEeGrAUG1Q91D7BDW90xRU/BFHxnIgbHE4b5WRWlA=; b=igVWaSASI5zspHxSS5+ex5tEIej213LGOVtys4jq7RZnpkbsxY6uLOkjH9SC/WNgKF trUXf3pISihq98figjEKXkiP9unv7rsENoDCg1NE60J0u28kEjT6BzpYjdMb4ARMxtSv KCa+YMx6TQpk4lV3WKjbEjlVvx1S2ZsV5hVso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=fJVJ4a2V+AxiD1Id3QMUIJWTnvGcUFSpj+j6Ra18eyeG39VE8e9Xa5v4bKTBJuX38D 4+qIX1M9/kCDY3DQbl9SzIUIhq3ICUSZThIL3DzdNhrR4/4daZtmEQohC75FaStQwlYY I0hspkEmdvSTvvJncMr5yTj37dvyN2sCHsTm0= MIME-Version: 1.0 Received: by 10.229.81.81 with SMTP id w17mr1907872qck.4.1266218479426; Sun, 14 Feb 2010 23:21:19 -0800 (PST) In-Reply-To: <4B78EFCC.2010102@caf.com.tr> References: <560f92641002142207w7eade79fr6a4f40ae5b92f4b9@mail.gmail.com> <4B78EFCC.2010102@caf.com.tr> Date: Sun, 14 Feb 2010 23:21:19 -0800 Message-ID: <560f92641002142321s246f15fcg6f233b0c152e1d6a@mail.gmail.com> From: Nerius Landys To: Eray Aslan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org 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 07:21:22 -0000 > >From the man page: > > Command Substitution > [...] > =A0If =A0the =A0substitution =A0appears within double quotes, word splitt= ing and > =A0 =A0 =A0 pathname expansion are not performed on the results. > > In other words: > > sh-4.0$ touch "x y" > sh-4.0$ for i in `ls`; do echo "$i"; done > x > y > sh-4.0$ for i in "`ls`"; do echo "$i"; done > x y > sh-4.0$ But in the case where you're assigning the output of ls directly to a variable like this: FOO=3D`ls` vs FOO=3D"`ls`" the text assigned to FOO is the same, right? I know that later if you do for f in $FOO; do done it's different from for f in "$FOO"; do done that much is clear.