From owner-freebsd-questions@FreeBSD.ORG Sun Aug 12 17:12:31 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 F3A9816A419 for ; Sun, 12 Aug 2007 17:12:30 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id AAD2813C465 for ; Sun, 12 Aug 2007 17:12:30 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from mr08.lnh.mail.rcn.net ([207.172.157.28]) by smtp02.lnh.mail.rcn.net with ESMTP; 12 Aug 2007 13:12:30 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr08.lnh.mail.rcn.net (MOS 3.8.3-GA) with ESMTP id IZM18815; Sun, 12 Aug 2007 13:12:29 -0400 (EDT) Received: from 65-78-26-179.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com (HELO jerusalem.litteratus.org.litteratus.org) ([65.78.26.179]) by smtp01.lnh.mail.rcn.net with ESMTP; 12 Aug 2007 13:12:28 -0400 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18111.16253.130080.423918@jerusalem.litteratus.org> Date: Sun, 12 Aug 2007 13:12:29 -0400 To: freebsd-questions@freebsd.org In-Reply-To: <20070812195535.V86618@obelix.home.rakhesh.com> References: <20070812195535.V86618@obelix.home.rakhesh.com> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr08.lnh.mail.rcn.net) Subject: 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: Sun, 12 Aug 2007 17:12:31 -0000 Rakhesh Sasidharan writes: > I understand that the default value of the IFS variable in bash > is "space, tab, newline". I believe this to be correct. > For a script I am playing around with, I want to change IFS to be > just newline. I tried the obvious like > > IFS="\n" > -or- > IFS='\n' > > but that doesn't seem to do the trick coz then the letter "n" > ends up being the separator. > > A bit of Google searching got me the solution too. That I must set IFS this > way: > > IFS=$'\n' It is also possible to use: IFS=" " with the default shell; this has been (personally) confirmed within the least few weeks. Robert Huff