LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is shell variable EDITOR obsolete? (https://www.linuxquestions.org/questions/linux-newbie-8/is-shell-variable-editor-obsolete-4175601428/)

fanoflq 03-09-2017 08:01 PM

Is shell variable EDITOR obsolete?
 
I looked at these links:

https://bash.cyberciti.biz/guide/Variables
http://askubuntu.com/questions/27596...current-values

But I am unable to find shell variable EDITOR using
command: set or declare -p

Is shell variable EDITOR obsolete?
If not, how do I find it?

frankbell 03-09-2017 08:12 PM

This may help: http://unix.stackexchange.com/questi...ommand-in-bash

Then there's this: http://askubuntu.com/questions/43252...nment-variable

goumba 03-09-2017 08:21 PM

You can not find EDITOR as it is likely not set. If an environment variable has not been defined, then it will not show up in printenv or similar commands.

add
Code:

export EDITOR=...
to .profile to set it. Log out, log in for it to take effect.

For a single shell session, you can type the above at a shell prompt. Be aware that it will no longer be set once you exit the shell.

fanoflq 03-09-2017 08:25 PM

Quote:

Originally Posted by frankbell (Post 5681403)


Thank you.
It looks like the shell variable EDITOR does not exists
until the user defines it.

chrism01 03-09-2017 10:44 PM

It is checked by some utils eg 'crontab -e ..' will look for it.

Habitual 03-13-2017 07:43 PM

Yes, in multi-seat computer systems with interactive shells and a number of editors
Code:

export EDITOR=vi
in ~/.bashrc

DavidMcCann 03-14-2017 01:38 PM

It's used by things like visudo when it's set. Since they all default to vi, it would only be set if (like me!) you want to avoid the use of vi.


All times are GMT -5. The time now is 03:40 AM.