Xref: utzoo comp.unix.questions:18398 unix-pc.general:4324 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!n8emr!uncle!donlash From: donlash@uncle.UUCP (Donald Lashomb) Newsgroups: comp.unix.questions,unix-pc.general Subject: Re: VISUAL/EDITOR = emacs in ksh Message-ID: <629@uncle.UUCP> Date: 13 Dec 89 02:42:19 GMT References: <464@cpsolv.UUCP> Reply-To: donlash@uncle.UUCP (Donald Lashomb) Organization: U.N.C.L.E. Lines: 34 In article <464@cpsolv.UUCP> rhg@cpsolv.uucp (Richard H. Gumpertz) writes: >I am using ksh on a AT&T 7300 (operating system release 3.51, which is roughly >equivalent to V 2) and have a few questions: >1) What is the difference between using VISUAL=emacs and EDITOR=emacs? Why > should I prefer one over the other? If you set VISUAL to a pathname that ends in emacs, gmacs, or vi, then ksh turns on the corresponding option no matter what EDITOR is set to - no default. EDITOR, same thing but can be overridden by VISUAL and defaults to /bin/ed. I usually set both of these and EDIT too, to all the same editor. Some programs you might use look at EDITOR, some look at EDIT. >2) My .profile does VISUAL=emacs followed by export VISUAL. Although this > defines $VISUAL, it does not appear to set emacs editing mode. For that > I have to type VISUAL=emacs manually to the shell. Why does ksh look at > just the variable and not the environment? What can I do to get around > this? Check out your ksh ENV file (.kshrc probably), .profile runs first, then ksh does ENV. AT&T-supplied .kshrc does "set -o vi -o viraw", this is overriding your VISUAL setup in .profile. Change it to "set -o emacs". >3) I would like to run the equivalent of a .profile in every sub-ksh that I > start. How do I go about doing that? That is, execute a script file and > then enter interactive mode upon invocation of ksh. The ENV file is executed everytime ksh is invoked. TFB (The F***ing Book) = The Kornshell Command and Programming Language Morris I. Bolsky and David G. Korn Prentice Hall hope this helps - Donald Lashomb