Date: Mon, 17 Apr 2000 21:46:36 -0500 (CDT) From: Steve Price <sprice@hiwaay.net> To: Paul Richards <paul@originative.co.uk> Cc: freebsd-chat@freebsd.org Subject: Re: Un*x scripting magic Message-ID: <Pine.OSF.4.21.0004172140100.30660-100000@fly.HiWAAY.net> In-Reply-To: <38FBCA3C.46380367@originative.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 18 Apr 2000, Paul Richards wrote:
# > Then I have a multi-line (printable characters only) ASCII
# > text file containing the message that I'd like to replace
# > for %%MESSAGE%%. [1] Anyone have a neat little trick in
# > their bag-o-magic? I know the answer should be really
# > obvious but everything I've tried thus either hasn't worked
# > or was too convoluted.
#
# What's wrong with the obvious?
It doesn't embed the text in the script. So everytime I
execute the script I have to re-read the file.
# open(MESSAGE, $MESSAGE) || die;
# while (<MESSAGE>) {
# $msg .= $_;
# }
#
# You can probably optimise that a bit, read the whole file in one go for
# starters.
As someone else pointed out something like this would work
if I didn't want to embed the content within the code in its
final form yet keep them separate while they are in CVS. :)
$msg = `cat foo`;
-steve
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.4.21.0004172140100.30660-100000>
