areacode.(danj1) minor customer dissatisfaction

Dan_Jacobson at ATT.COM Dan_Jacobson at ATT.COM
Sun Aug 19 06:37:04 AEST 1990


Tony_Hansen at ATT.COM and a few others pointed out to me that my recent
areacode shell script has the following poor taste:
:    o	It exec's egrep from a here-doc. This doesn't allow the shell to
:	clean up the temporary file that it has to create to pass to egrep.
:	Consequently, EVERY time the program is run, a file in /tmp gets
:	created and not removed. Either remove the "exec" or split the
:	program into two pieces: the shell and a separate data file which
:	contains the areacode information.

ok ok, I removed the exec [on the one I give to folks that e-mail me].
(total change (for those want to adjust their copies): deleted 4
characters and a blank.)

[On my computer there is no tmp file left over, but I believe you.]

:    o	The program is very slow because it has to recreate the temporary
:	data file every time the program is run.

Well "egrep string $0" doesn't work, as $0 is different in different
shells... and the `here document' (/bin/sh: "<<") is a nice way to keep
it together especially when you have no idea what on computers or in
what directories it will end up.  Other ways to deal with this don't
seem too elegant.
-- 
Dan_Jacobson at ATT.COM +1-708-979-6364



More information about the Alt.sources.d mailing list