Date: Mon, 25 May 2009 13:10:48 +0100 From: Matthew Seaman <m.seaman@infracaninophile.co.uk> To: Unga <unga888@yahoo.com> Cc: freebsd-questions@freebsd.org Subject: Re: How to say this in Bash? Message-ID: <4A1A8AC8.5020007@infracaninophile.co.uk> In-Reply-To: <898369.52568.qm@web57006.mail.re3.yahoo.com> References: <898369.52568.qm@web57006.mail.re3.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
Unga wrote:
> Dear all
>
> This may be slightly OT, but I'm using on a FreeBSD machine. How
> to convert following into bash style?
>
> echo "${X}" > ${Z}
> echo "${Y}" >> ${Z}
>
Exactly the same in posix standard /bin/sh or in bash. bash(1) should
be capable of running any compliant /bin/sh script directly. The converse
is not generally true, so for maximum portability write according to sh(1)
and avoid bash-isms.
If you're asking about converting csh to bourne shell, then that's a whole
other kettle of fish. The echo commands above just happen to be the same in
either language, but that's one of the few points of confluence between the
two. Typically you'ld have to know both languages and laboriously translate
between them.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
Kent, CT11 9PW
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEAREIAAYFAkoais4ACgkQ8Mjk52CukIw10QCfYVGWXEoC1Jxvv4qHlVcbBnco
U6kAn3kb6OD1P9qZXBAcibftT+HnpPbX
=3uIU
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A1A8AC8.5020007>
