LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 08: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, 08: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: 19,310
Blog Entries: 28

Rep: Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137Reputation: 6137
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, 08:21 PM   #3
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
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 08:29 PM.
 
1 members found this post helpful.
Old 03-09-2017, 08: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, 10:44 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,355

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
It is checked by some utils eg 'crontab -e ..' will look for it.
 
1 members found this post helpful.
Old 03-13-2017, 07:43 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
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, 01:38 PM   #7
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,137

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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 01:28 PM
[SOLVED] ksh read variable from text file and populate with content of shell variable WindozBytes Programming 4 09-17-2012 01:48 PM
Shell scripting : how to name a variable with the value of another variable JimOrJoe Programming 9 06-15-2008 09:36 PM
Problem with the EDITOR variable objorkum Slackware 2 10-19-2004 03:29 PM
Terminal editor's path/variable Will Linux - General 1 11-10-2001 03:32 AM

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

All times are GMT -5. The time now is 01:02 PM.

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
Open Source Consulting | Domain Registration