Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!styx!ames!amdahl!fai!stevem From: stevem@fai.UUCP (Steve Minneman) Newsgroups: comp.unix.questions Subject: Re: Anonymous Mail Message-ID: <508@fai.UUCP> Date: Fri, 14-Nov-86 13:20:07 EST Article-I.D.: fai.508 Posted: Fri Nov 14 13:20:07 1986 Date-Received: Sun, 16-Nov-86 00:21:51 EST Reply-To: stevem@fai.UUCP (Steve Minneman) Distribution: na Organization: Fujitsu America, Inc. Lines: 40 As Tony Hansen pointed out to me, although the script I submitted to cope with the anonymous mail question worked if it was executed without a . in front, there was an error. The text of his message to me pointing out the problem and suggesting an even better solution follows: ************************************************************************** There are a couple of things wrong with your sample script: SAVE1='LOGNAME' This sets the value of the variable SAVE1 to the string "LOGNAME" and NOT the value of the environment variable $LOGNAME. To do that you would want: SAVE1="$LOGNAME" Note the use of double quotes and the use of the dollar-sign. Also, there is no need to save and restore the environment variables since this code would presumably be placed in a separate script to be executed and not dotted. Any changes made to environmentu variables in subshells have no effect on the values within the parent shell. I would probably write the code as follows: LOGNAME='proper!unknown!poster' NAME='I. A. M. Anonymous' mailx $1 Placing the variable settings on the same line as the invocation of mailx will cause them to only be set and exported for that command. Tony Hansen ihnp4!pegasus!hansen -- Steven A. Minneman (Fujitsu America Inc, San Jose, Ca) !seismo!amdahl!fai!stevem or !ihnp4!pesnta!fai!stevem The best government is no government at all.