Path: utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!pacbell!att!cbnewse!danj1 From: Dan_Jacobson@ATT.COM Newsgroups: alt.sources.d Subject: areacode.(danj1) minor customer dissatisfaction Message-ID: <1990Aug18.203704.8095@cbnewse.att.com> Date: 18 Aug 90 20:37:04 GMT Sender: danj1@cbnewse.att.com (Dan Jacobson) Organization: AT&T-BL, Naperville IL, USA Lines: 25 Tony_Hansen@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@ATT.COM +1-708-979-6364