Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!harvard!bu-cs!root From: root@bu-cs.UUCP (Barry Shein) Newsgroups: net.micro.att Subject: Re: fix for lack of editor escape in mail on 7300 Message-ID: <512@bu-cs.UUCP> Date: Sun, 21-Jul-85 12:44:10 EDT Article-I.D.: bu-cs.512 Posted: Sun Jul 21 12:44:10 1985 Date-Received: Tue, 23-Jul-85 04:49:04 EDT References: <623@astrovax.UUCP> Organization: Boston Univ Comp. Sci. Lines: 34 >From: richmon@astrovax.UUCP (Michael Richmond) >Subject: fix for lack of editor escape in mail on 7300 > > When I discovered that one cannot use the tilde escapes such as ~v or >~p while in mail on my 7300 ... So I worked up the following short >shell script to automatically put me in vi (or whatever editor is desired) >when I invoke mail, and use the file thus created as the message. A fine suggestion, but may I suggest a slight improvement, the following: if test $# -lt 1 then /bin/mail else tmpfile = /tmp/LET$$ /usr/bin/vi $tmpfile if test -s $tmpfile then /bin/mail $1 $2 $3 < $tmpfile /bin/rm $tmpfile fi fi Sets the shell variable 'tmpfile' to /tmp/LETnnnn where nnnn is the process id of the shell (eg. /tmp/LET579). Then if, for example, you pushed out of the editor and invoked this script again (say you suddenly realized you needed to ask someone else about something before finishing the letter) you wouldn't trash the original file (or if there were more than one user, etc.) Just a suggestion, also a general one when creating tmp files in shell scripts (warning: I didn't try the above, forgive slight errors, the point is that '$$' is a built-in variable with the pid of the shell executing the script which should be unique enough.) -Barry Shein, Boston University