From owner-freebsd-questions@FreeBSD.ORG Mon Aug 13 04:17:02 2007 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 854CF16A418 for ; Mon, 13 Aug 2007 04:17:02 +0000 (UTC) (envelope-from rakheshster@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by mx1.freebsd.org (Postfix) with ESMTP id D334513C46B for ; Mon, 13 Aug 2007 04:17:01 +0000 (UTC) (envelope-from rakheshster@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so454108nfb for ; Sun, 12 Aug 2007 21:17:00 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:date:x-x-sender:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type:from:sender; b=jql0FlYaoUmZ4DIqEIkr4wrHQXQQJmgCjJttyEwn143/rywzMUvomDoNjSfdumkyoBFX++eAcxrT0qofosEVi9gyCV82U6OZ3pGVhJ/zb9atT4Q0PYFFIibNfZStsxo8wGAfl+EL+paTYdQZHAD7p0bnrLy2rGdKWyhAjHYT6nw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:x-x-sender:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type:from:sender; b=O6x6pr6xhnuaMuD5pXlRxa+EBxkn9osDt2ZiyjZe8mTDTMUH1jaRtXppu1MHTHHs26S1/AqRXTUSGOJp4pBljdJQRI5HOywDvbnbNwNTE5sPTaquCgl3w4M4H5fIi/oL4wl1JeR+X3qbSbVgMxBB03pgCUPtv8oKw1jEEJJ1y+A= Received: by 10.78.81.20 with SMTP id e20mr1989977hub.1186978620350; Sun, 12 Aug 2007 21:17:00 -0700 (PDT) Received: from smtp.home.rakhesh.com ( [82.178.137.21]) by mx.google.com with ESMTPS id s34sm1787306hub.2007.08.12.21.16.55 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2007 21:16:57 -0700 (PDT) Received: from obelix.home.rakhesh.com (obelix.home.rakhesh.com [192.168.17.13]) by smtp.home.rakhesh.com (Postfix) with ESMTP id 36F9D5080A; Mon, 13 Aug 2007 08:16:27 +0400 (GST) Date: Mon, 13 Aug 2007 08:16:27 +0400 (GST) X-X-Sender: rakhesh@obelix.home.rakhesh.com To: Manolis Kiagias In-Reply-To: <46BF5AE4.2010206@otenet.gr> Message-ID: <20070813081337.E44584@obelix.home.rakhesh.com> References: <20070812195535.V86618@obelix.home.rakhesh.com> <46BF5AE4.2010206@otenet.gr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Rakhesh Sasidharan Sender: Rakhesh Sasidharan Cc: freebsd-questions@freebsd.org Subject: Re: Question on the IFS variable (not a FreeBSD 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, 13 Aug 2007 04:17:02 -0000 Manolis Kiagias wrote: > Do a little experiment (inspired from the post stated above): > #export IFS="\n" > #printf '<%s>\n' "$IFS" | cat -vt > will give <\n> ==> not what you expect > #export IFS='\n' > #printf '<%s>\n' "$IFS" | cat -vt > will give <\n> ==> again, not what you expect > #export IFS=$'\n' > #printf '<%s>\n' "$IFS" | cat -vt > will give > < >> > definitely a new line character (finally...) > I am not certain of the explanation, but from the above it seems to me > the IFS does not evaluate special '\something' characters unless there > is a $ in front. That is, of course, what you would do to get the value > of a shell variable. It seems then these characters need to be evaluated > in the same way. Yup, that's what I too figured from my experiments. Strange. Oh well ... good to know now that '\n' (even in double quotes etc) need not always refer to the newline. Sometimes the $ magic is required ... :-) Thanks! Rakhesh