From owner-freebsd-questions@FreeBSD.ORG Mon May 25 14:36:46 2009 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 916881065687 for ; Mon, 25 May 2009 14:36:46 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: from web57006.mail.re3.yahoo.com (web57006.mail.re3.yahoo.com [66.196.97.110]) by mx1.freebsd.org (Postfix) with SMTP id 392B28FC1C for ; Mon, 25 May 2009 14:36:45 +0000 (UTC) (envelope-from unga888@yahoo.com) Received: (qmail 70277 invoked by uid 60001); 25 May 2009 14:36:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1243262205; bh=v8Xn4ENZ3Vzj4Qq4lfyEMMzfCEXFJwi5SNIHR1bb2M4=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=Iywk8+A6SPQN0oyyMPEPaatCOhWiKsBtp02osX+RkK0nvjpseWZwB/E9Z1SXxXzqI/hYQ1z5CT6dnUZi737RhZ3stXvEejxR32jUaJhrXv09s7iVmFvy1PlxXIvoVEqszUQipsrS+4Gcd6IPZAxeu3RiUF//Jemm1u+jFslP7sM= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding; b=pUK8c34m22vzZYRTRROFjJ8pQuR2DFxcDsgmgkB0MAz9/sFOvbcqlELCgAiGMAgioqv0Pps3B4CkTx9c4C+Me1nWOeeX7j7kStiD01TPDdhQsj5/JmqMWmmgEJP5LMZcvRrvweDqYDDHw+jg9vZLHdojCIDM3fY4nlwdRIYRhck=; Message-ID: <141688.69137.qm@web57006.mail.re3.yahoo.com> X-YMail-OSG: sDJ54GsVM1npB7EGx3NStPPTpzBKILS1Iss4lKrtSuO4S64aM4JeeMnBCsl77kodc3tWtAnnpAZbOecnFKhomRTXFBqLmEpTYT_Myg0rKFVjgLQN1KlDtIXy.Xn02WeaOTYLE0oGY64G59WNUT4am7Au6ITYMvOm4Hm2HuFCHB48K5E1T1e6AXm0nXePuSXOaoHFuKSMAgGE6zmG1mAWtitlssgsUIBwGqko.hDeWGt8KV9JE.S__cRXoSV95CuXPf4qo.TtJCuBa_In6ASEvxzhWOzWgfrdG3lxoO7KRrapjHePXxeG8EE6yXpHa825BlqBEiT_zpBDbsEyDdrcziaBa3KwXAvRZkpFOvc- Received: from [220.255.7.182] by web57006.mail.re3.yahoo.com via HTTP; Mon, 25 May 2009 07:36:45 PDT X-Mailer: YahooMailClassic/5.3.9 YahooMailWebService/0.7.289.10 Date: Mon, 25 May 2009 07:36:45 -0700 (PDT) From: Unga To: Matthew Seaman MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: How to say this in Bash? 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, 25 May 2009 14:36:46 -0000 --- On Mon, 5/25/09, Matthew Seaman wrote= :=0A=0A> From: Matthew Seaman =0A> Subject= : Re: How to say this in Bash?=0A> To: "Unga" =0A> Cc: f= reebsd-questions@freebsd.org=0A> Date: Monday, May 25, 2009, 8:10 PM=0A> Un= ga wrote:=0A> > Dear all=0A> > =0A> > This may be slightly OT, but I'm usin= g on a FreeBSD=0A> machine. How=0A> > to convert following into bash style?= =0A> > =0A> > echo "${X}" > ${Z}=0A> > echo "${Y}" >> ${Z}=0A> > =0A> =0A> = Exactly the same in posix standard /bin/sh or in=0A> bash.=A0 bash(1) shoul= d=0A> be capable of running any compliant /bin/sh script=0A> directly.=A0 T= he converse=0A> is not generally true, so for maximum portability write=0A>= according to sh(1)=0A> and avoid bash-isms.=0A> =0A> If you're asking abou= t converting csh to bourne shell, then=0A> that's a whole=0A> other kettle = of fish.=A0 The echo commands above just=0A> happen to be the same in=0A> e= ither language, but that's one of the few points of=0A> confluence between = the=0A> two.=A0 Typically you'ld have to know both languages and=0A> labori= ously translate=0A> between them.=0A> =0A=0AHere is what happens in bash sh= ell:=0A$ echo "${X}" > ${Z}=0Abash: ${Z}: ambiguous redirect=0A=0ABest rega= rds=0AUnga=0A=0A=0A=0A