Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 May 2009 07:36:45 -0700 (PDT)
From:      Unga <unga888@yahoo.com>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to say this in Bash?
Message-ID:  <141688.69137.qm@web57006.mail.re3.yahoo.com>

next in thread | raw e-mail | index | archive | help

--- On Mon, 5/25/09, Matthew Seaman <m.seaman@infracaninophile.co.uk> wrote=
:=0A=0A> From: Matthew Seaman <m.seaman@infracaninophile.co.uk>=0A> Subject=
: Re: How to say this in Bash?=0A> To: "Unga" <unga888@yahoo.com>=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      



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?141688.69137.qm>