From owner-freebsd-questions@FreeBSD.ORG Fri Sep 28 18:39:53 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 0838616A417 for ; Fri, 28 Sep 2007 18:39:53 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.freebsd.org (Postfix) with ESMTP id DAD6613C461 for ; Fri, 28 Sep 2007 18:39:52 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from relay11.apple.com (relay11.apple.com [17.128.113.48]) by mail-out3.apple.com (Postfix) with ESMTP id BF1E0130301C; Fri, 28 Sep 2007 11:39:52 -0700 (PDT) Received: from relay11.apple.com (unknown [127.0.0.1]) by relay11.apple.com (Symantec Mail Security) with ESMTP id A5DEF28059; Fri, 28 Sep 2007 11:39:52 -0700 (PDT) X-AuditID: 11807130-a2bc0bb000004daf-a3-46fd4a78ccf0 Received: from [17.214.13.96] (cswiger1.apple.com [17.214.13.96]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by relay11.apple.com (Apple SCV relay) with ESMTP id 8B7362804E; Fri, 28 Sep 2007 11:39:52 -0700 (PDT) In-Reply-To: <21079.67.171.53.31.1191004462.squirrel@admintool.trueband.net> References: <21079.67.171.53.31.1191004462.squirrel@admintool.trueband.net> Mime-Version: 1.0 (Apple Message framework v752.2) X-Priority: 3 (Normal) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Chuck Swiger Date: Fri, 28 Sep 2007 11:39:51 -0700 To: jhall@vandaliamo.net X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-questions@freebsd.org Subject: Re: Adding CR/LF 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: Fri, 28 Sep 2007 18:39:53 -0000 On Sep 28, 2007, at 11:34 AM, jhall@vandaliamo.net wrote: > Here is the script I am using. > #!/bin/sh > FILENAMES="test1 test2 test3" > FILELIST="" > for filename in ${FILENAMES} > do > FILELIST="${FILELIST}${filename}"$'\n\r' > echo ${FILELIST} > done > > And, here is the output I am getting. > test1$\n\r > test1$\n\rtest2$\n\r > test1$\n\rtest2$\n\rtest3$\n\r > > The output I would like to see is: > test1 > test2 > test3 > > Thanks in advance for your assistance. /bin/echo and the builtin echo command found in /bin/sh and /bin/tcsh do not understand the C-style \r and \n escapes; you could switch your script to using Bash or ZSH and it would work in those shells, or else use printf command rather than echo. "man builtin" might give some insight. -- -Chuck