From owner-freebsd-questions Sun Dec 2 15: 1:11 2001 Delivered-To: freebsd-questions@freebsd.org Received: from lists.blarg.net (lists.blarg.net [206.124.128.17]) by hub.freebsd.org (Postfix) with ESMTP id 4459737B41C for ; Sun, 2 Dec 2001 15:01:02 -0800 (PST) Received: from thig.blarg.net (thig.blarg.net [206.124.128.18]) by lists.blarg.net (Postfix) with ESMTP id DD4DABD49; Sun, 2 Dec 2001 15:01:01 -0800 (PST) Received: from localhost.localdomain ([206.124.139.115]) by thig.blarg.net (8.9.3/8.9.3) with ESMTP id PAA00561; Sun, 2 Dec 2001 15:01:01 -0800 Received: (from jojo@localhost) by localhost.localdomain (8.11.6/8.11.3) id fB2N1C712754; Sun, 2 Dec 2001 15:01:13 -0800 (PST) (envelope-from swear@blarg.net) To: cjclark@alum.mit.edu Cc: Darren Pilgrim , freebsd-questions@FreeBSD.ORG Subject: Re: Changing $IFS in a bash shell References: <3C097584.B51ECEBC@pantherdragon.org> <20011201173255.N13613@blossom.cjclark.org> <20011201215816.P13613@blossom.cjclark.org> From: swear@blarg.net (Gary W. Swearingen) Date: 02 Dec 2001 15:01:11 -0800 In-Reply-To: <20011201215816.P13613@blossom.cjclark.org> Message-ID: <6tg06tp6q0.06t@localhost.localdomain> Lines: 19 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG "Crist J . Clark" writes: > > 3) In ksh shell, this works: IFS="\n" > > But it doesn't work in bash. So I thought I would give another one-liner that does, but I see that bash, sh and ksh all strip trailing newlines with things like: XXX=$(printf '\n') XXX=`echo` Except that ksh (only) will leave in a newline with: XXX=$(printf '\\n') Tested with: echo -n "$XXX" | hd To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message