From owner-freebsd-questions@FreeBSD.ORG Sun Aug 12 15:58:07 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 7F3E116A41B for ; Sun, 12 Aug 2007 15:58:07 +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 0AE4313C45A for ; Sun, 12 Aug 2007 15:58:06 +0000 (UTC) (envelope-from rakheshster@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so415321nfb for ; Sun, 12 Aug 2007 08:58:05 -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:subject:message-id:mime-version:content-type:from:sender; b=ceP565w+au02H3B7vfnro4Zc/FluRshcdTrDXCk+fGoN3+zHR5SQehrOwTF0D6hoZ3HHFMiOIiFX82jhtgDtSs6CqaEQlummK09HHjg6cKwV+WRPgttL5PDbf9nYk6npDScdEPMYSrFb54Tq2DWjigeaeZYzUmATB1uu5RTTDIw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:x-x-sender:to:subject:message-id:mime-version:content-type:from:sender; b=pDgqtXrpUQPQxC7BDBZMwXILhEu4PauuBgayKji+hQAj2k5aY0Pvh7qp7S5y/xLP/VC5s0CnyYGQF9gvdg5nNV94wE5AZEEJpQtANYh9mhHe3WHfWp8WKt9E8ohzKdBQAp4QYZK8RDfemLe6pX7W724hX4TN3/513V6zi30J+qc= Received: by 10.78.201.10 with SMTP id y10mr1489741huf.1186934285608; Sun, 12 Aug 2007 08:58:05 -0700 (PDT) Received: from smtp.home.rakhesh.com ( [82.178.137.21]) by mx.google.com with ESMTPS id s36sm1622488hub.2007.08.12.08.58.03 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Aug 2007 08:58:04 -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 61F215080A for ; Sun, 12 Aug 2007 19:57:33 +0400 (GST) Date: Sun, 12 Aug 2007 19:57:33 +0400 (GST) X-X-Sender: rakhesh@obelix.home.rakhesh.com To: freebsd-questions@freebsd.org Message-ID: <20070812195535.V86618@obelix.home.rakhesh.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed From: Rakhesh Sasidharan Sender: Rakhesh Sasidharan 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 15:58:07 -0000 Hi, This isn't really a FreeBSD question. But I figure most people on this list would know the answer and so I'm asking. I've tried to get the answer out of Google, but I guess I am not asking it the right question and so not getting much hits. I understand that the default value of the IFS variable in bash is "space, tab, newline". 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' I did that, and sure enough things work the way I want! So my question is this: how come things work when I set IFS to $'\n' instead of just plain '\n'? I don't recollect seeing such a way of setting variables before, and so I'm curious about it. TIA, Rakhesh