LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-09-2017, 09:01 PM   #1
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Rep: Reputation: Disabled
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?
 
Old 03-09-2017, 09:12 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,870
Blog Entries: 27

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

Then there's this: http://askubuntu.com/questions/43252...nment-variable
 
1 members found this post helpful.
Old 03-09-2017, 09:21 PM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Current: Debian and OpenSUSE. Past: Arch, RedHat (pre-RHEL). FreeBSD & OpenBSD novice, Hackintosh
Posts: 1,192
Blog Entries: 7

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
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.

Last edited by goumba; 03-09-2017 at 09:29 PM.
 
1 members found this post helpful.
Old 03-09-2017, 09:25 PM   #4
fanoflq
Member
 
Registered: Nov 2015
Posts: 397

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post

Thank you.
It looks like the shell variable EDITOR does not exists
until the user defines it.
 
Old 03-09-2017, 11:44 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.5
Posts: 17,700

Rep: Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494Reputation: 2494
It is checked by some utils eg 'crontab -e ..' will look for it.
 
1 members found this post helpful.
Old 03-13-2017, 08:43 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Yes, in multi-seat computer systems with interactive shells and a number of editors
Code:
export EDITOR=vi
in ~/.bashrc
 
1 members found this post helpful.
Old 03-14-2017, 02:38 PM   #7
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Xubuntu
Posts: 5,431

Rep: Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891Reputation: 1891
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best shell script editor? damuser Linux - Newbie 15 12-26-2015 02:28 PM
[SOLVED] ksh read variable from text file and populate with content of shell variable WindozBytes Programming 4 09-17-2012 02:48 PM
Shell scripting : how to name a variable with the value of another variable JimOrJoe Programming 9 06-15-2008 10:36 PM
Problem with the EDITOR variable objorkum Slackware 2 10-19-2004 04:29 PM
Terminal editor's path/variable Will Linux - General 1 11-10-2001 04:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration